View Issue Details

IDProjectCategoryView StatusLast Update
0026110mantisbtadministrationpublic2019-09-27 02:35
Reporterkuz30 Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version2.22.0 
Target Version2.22.1Fixed in Version2.22.1 
Summary0026110: [Show content] for Complex Configuration option doesn't work when mod_rewrite is disabled
Description

Standalone production MantisBT with default configuration.
On page adm_config_report.php (Manage / Manage configuration / Configuration Report) for Configuration Option with type complex when clicking Value field [Show content] it doesn't work and produces browser console error:
`POST .../api/rest/internal/config_display 404

Steps To Reproduce
  1. Create Configuration Option with type complex
  2. Try to view value of clicking [Show content]
Additional Information

Workaround possible if you click Edit one by one.

TagsNo tags attached.

Activities

kuz30

kuz30

2019-09-04 08:37

reporter  

image.png (51,739 bytes)   
image.png (51,739 bytes)   
dregad

dregad

2019-09-04 10:23

developer   ~0062725

Can you please check if there is any output (errors) in the browser's console ?
What web server are you using ?
REST API relies on URL rewriting to use /mantis/api/rest/xxx URLs. Can you confirm that URL rewriting is configured correctly ?

I faced a similar issue in the past in a plugin (see https://github.com/mantisbt-plugins/Snippets/issues/31). Can you try modifiying js/adm_config_report.js, at line 45

-                   content.load('api/rest/internal/config_display',req_data);
+                   content.load('api/rest/index.php/internal/config_display',req_data);
kuz30

kuz30

2019-09-05 03:11

reporter   ~0062730

Web server is Apache/2.4.7 (Ubuntu).
Module rewrite says Module rewrite already enabled.
When you click you get AJAX Post 404 in console (check image).

Your proposed modification resolves an issue.

image-2.png (19,491 bytes)   
image-2.png (19,491 bytes)   
dregad

dregad

2019-09-06 03:23

developer   ~0062738

@kuz30 thanks for the feedback.

I'll implement the proposed change in core as I think that internal REST API call need to work regardless of the webserver's configuration.

That being said, there is something wrong with your configuration. If you're planning to use the REST API externally, you'll need to sort this out otherwise the expected "nice" URLS like http://path.to/mantis/api/rest/<endpoint> will not work and you'll need to add the /index.php bit as per my earlier message

Note: the mod rewrite configuration is handled via an .htaccess file. Maybe your webserver config is blocking that.

dregad

dregad

2019-09-06 04:32

developer   ~0062742

PR https://github.com/mantisbt/mantisbt/pull/1559

Related Changesets

MantisBT: master c4a2cdd9

2019-09-04 11:30:38

dregad

Details Diff
Use REST API full path (with index.php)

On web servers where URL rewriting is not properly configured, calling
REST API with the "short" URL, e.g. http://my.mantis/rest/api/issues
does not work.

To make sure that core functionality relying on REST calls (via the
'internal' route) is working is expected even when URL rewriting is not
operational, we use the full path including the index.php file:
http://my.mantis/rest/api/index.php/internal/...

Fixes 0026110
Affected Issues
0026110
mod - js/adm_config_report.js Diff File
mod - js/common.js Diff File

MantisBT: master-2.22 a7413daa

2019-09-04 11:30:38

dregad

Details Diff
Use REST API full path (with index.php)

On web servers where URL rewriting is not properly configured, calling
REST API with the "short" URL, e.g. http://my.mantis/rest/api/issues
does not work.

To make sure that core functionality relying on REST calls (via the
'internal' route) is working is expected even when URL rewriting is not
operational, we use the full path including the index.php file:
http://my.mantis/rest/api/index.php/internal/...

Fixes 0026110

(cherry picked from commit c4a2cdd9d8d443a84287756959f595728a1524c9)
Affected Issues
0026110
mod - js/adm_config_report.js Diff File
mod - js/common.js Diff File

Issue History

Date Modified Username Field Change
2019-09-04 08:37 kuz30 New Issue
2019-09-04 08:37 kuz30 File Added: image.png
2019-09-04 10:23 dregad Status new => feedback
2019-09-04 10:23 dregad Note Added: 0062725
2019-09-05 03:11 kuz30 File Added: image-2.png
2019-09-05 03:11 kuz30 Note Added: 0062730
2019-09-05 03:11 kuz30 Status feedback => new
2019-09-06 03:23 dregad Note Added: 0062738
2019-09-06 03:23 dregad Assigned To => dregad
2019-09-06 03:23 dregad Status new => assigned
2019-09-06 04:32 dregad Note Added: 0062742
2019-09-13 02:02 dregad Changeset attached => MantisBT master c4a2cdd9
2019-09-13 02:02 dregad Status assigned => resolved
2019-09-13 02:02 dregad Resolution open => fixed
2019-09-13 02:02 dregad Fixed in Version => 2.23.0
2019-09-13 02:09 dregad Fixed in Version 2.23.0 => 2.22.1
2019-09-13 02:09 dregad Target Version => 2.22.1
2019-09-13 02:09 dregad Summary [Show content] for Complex Configuration option doesn't work => [Show content] for Complex Configuration option doesn't work when mod_rewrite is disabled
2019-09-13 02:09 dregad Description Updated View Revisions
2019-09-13 02:09 dregad Steps to Reproduce Updated View Revisions
2019-09-13 02:09 dregad Changeset attached => MantisBT master-2.22 a7413daa
2019-09-27 02:35 dregad Note Added: 0062922
2019-09-27 02:35 dregad Status resolved => closed