Issue Task Closed

#54813BackendConfigurationManager figures out wrong pid

Felix Oertel 01/07/14, 16:55 updated 04/21/20, 12:16

Description

For backend modules, in Configuration/BackendConfigurationManager.php:getCurrentPageId() we try to find the current pid. If we are in Web->, the id is readable via _GP(‘id’), everything is fine.

If we are outside Web->, there is no pid. The manager then tries to figure some useful pid out. It first looks for a page markes “is_siteroot” and then a sys_template marked “root”. While the treeroot is id 0, the manager will usually use id 1, because this is, where the root template resides.

This causes problems with caching, because the core takes id 0 for “global” scope. For example the caches in “cf_cache_pagesection” are generated (and tagged) for pid 0, if no specific pid is given.

While the method is currently protected and I don’t think too much people will have their configurationManager inherited, this still would be a breaking change. It’s a bug, so breaking change would be ok, but some people mind find, it’s not quiet the right time for that.

If that would be the case, I would propose deprecating this method and introducing a new one to deal with the pid correctly.

Reviews 2