core icon indicating copy to clipboard operation
core copied to clipboard

Refactor Reorder-Menu-Items portlet to not POST reordered menu-items over query-string

Open agomez-dotcms opened this issue 9 years ago • 6 comments

Reorder-Menu-Items portlet is relying on query-string for sending reordered menu-items. This may cause error "HTTP code 414 Request-URI Too Large" from NGINX (on dotCMS Cloud servers) at the moment the reordered menu-items are saved and when the menu-items tree is quite big. Instead, the POST request should send the reordered menu-items over request-body.

Expected Behavior

Reorder-Menu-Items portlet should be able to save reordered menu-items when the menu-items tree is big. That can be achieved by having Reorder-Menu-Items portlet should sending the reordered menu-items tree over POST request body

Current Behavior

Reorder-Menu-Items portlet is not able to save a big tree of reordered menu-items. When NGINX is configured in front of dotCMS's tomcat and upon clicking on the "Save Changes" button on Reorder-Menu-Items portlet, the POST request fails with error "HTTP code 414 Request-URI Too Large" from NGINX. This is caused by the fact that the reordered menu-items tree is submitted over POST request query-string

screen shot 2017-03-24 at 4 05 07 pm

Steps to Reproduce (for bugs)

The behavior with which Reorder-Menu-Items portlet sends reordered menu-items over query-string can be reproduced on latest dotCMS 4.0 demo site (https://demo.dotcms.com) with following steps:

  1. Log into https://demo.dotcms.com
  2. Go to Site Browser and click on folder "services"
  3. Double click on page "first-time-investors"
  4. Click on button "Lock for editing" at top-right side
  5. Click on "Reorder Menu" icon on menu at left-hand-side
  6. On Reorder-Menu-Items portlet, click on button "Save Changes"
  7. Inspect query-string generated for previous POST request and confirm that big menu-item trees would generate error "HTTP code 414 Request-URI Too Large" from NGINX
screen shot 2017-03-24 at 3 39 50 pm screen shot 2017-03-24 at 3 40 17 pm screen shot 2017-03-24 at 3 38 54 pm

Context

The error documented on this issue (ie. "HTTP code 414 Request-URI Too Large" from NGINX) can only be reproduced over big menu-items trees. This has been the case for one of dotCMS's Cloud clients on dotCMS 3.7.1 version, which reported the issue that is currently tracked at https://my.dotcms.com/tickets/detail.dot?id=59edb35c-9b40-4186-a526-40b5417487ee. It has been analyzed that this requires refactorings on both Client-Side and Server-Side code and that is potentially affecting latest dotCMS versions (3.7.1 and 4.0)

Your Environment

  • dotCMS version used: 3.7.1 and 4.0
  • Browser Name and version: Firefox
  • Operating System and version: Mac OSX
  • Application Server and version: Tomcat
  • Database and version: Postgres

agomez-dotcms avatar Mar 24 '17 22:03 agomez-dotcms

@gabbydotCMS did we try my suggestion on the ticket?

wezell avatar Apr 28 '17 14:04 wezell

@wezell not yet, I'll give you an update today

gabbydotCMS avatar Apr 28 '17 14:04 gabbydotCMS

PR Core: https://github.com/dotCMS/core/pull/11669

nollymar avatar May 22 '17 19:05 nollymar

PR Core release 4.1.0: https://github.com/dotCMS/core/pull/11694

oarrietadotcms avatar May 24 '17 14:05 oarrietadotcms

Hotfix was successful on client's dEC environment https://my.dotcms.com/tickets/detail.dot?id=59edb35c-9b40-4186-a526-40b5417487ee

gabbydotCMS avatar May 26 '17 19:05 gabbydotCMS

Thanks for the confirmation @gabbydotCMS

shaydotcms avatar May 26 '17 22:05 shaydotcms