silverstripe / silverstripe-cms

Silverstripe CMS - this is a module for Silverstripe Framework rather than a standalone app. Use https://github.com/silverstripe/silverstripe-installer/ to set this up.
http://silverstripe.org/
BSD 3-Clause "New" or "Revised" License
516 stars 333 forks source link

SiteTree search form doesn't load in certain URLs #2277

Closed ScopeyNZ closed 6 years ago

ScopeyNZ commented 6 years ago

Using the new SiteTree search (^4.3@dev).

If I have versioned admin 1.x-dev and I browse to the history section on a page the search form on the SiteTree never loads:

image

It appears that the URL for the schema endpoint is not correct here. This means it miiight be a versioned-admin problem as it has a controller with its own "schema" endpoints, but versioned-admin does pass back to parent controllers given it doens't know about the form being requested.

Pull requests

maxime-rainville commented 6 years ago

I set the impact to high because this needs to be resolved before we release SilverStripe 4.3.

maxime-rainville commented 6 years ago

Found the problem. While the main request is handled by CMSPageHistoryViewerController, follow up requests (treeview and form schema) are handled by the original CMSPageHistoryController.

The reason for that is that HistoryControllerFactory can't find an ID attached to those follow up request. So HistoryControllerFactory will default to returning CMSPageHistoryController.

Fixing HistoryControllerFactory is probably the best way of addressing this. We already have an issue opened for defaulting to the new History controller. Those two issues are dealing with the exact same piece of code, so it's probably best to deal with them simultaneously and save ourselves are merge conflict.

On a related note, I'm getting an horizontal scrollbar in the site tree advanced filter when I force CMSPageHistoryViewerController. We need to look at that as well.

image.png