New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use meta data before searching page by controller #2178
Conversation
`self::getActiveRequest()->getPageID() ?: null;` will check the meta data for a page id before it searches the first match of the controller's classname. This is also used by the BoxHandler, so it seems to be inconsistent in it's handling. In some special cases (in my case it's a Fireball-Page) the BoyHandler will return a valid page id and assigns the boxes correctly while this method returns null or the first match which is wrong in the most cases. This change would improve the page-mapping and should not have any unwanted side-effects. You also could shorten the whole method to ```php if (self::getActiveRequest() === null) { return null; } return self::getActiveRequest()->getPageID() ?: null; ``` because it covers both look-ups the method contains (before this commit).
From what I can tell, b212ba6 should've resolved this issue already? |
No, there was a special case (which is important for a plugin by me), which is not covered, because WCF/wcfsetup/install/files/lib/system/request/Request.class.php Lines 169 to 185 in b212ba6
If I'm remembering correctly, this method is also called somewhere else for getting the active page. |
The |
The matching of WoltLab-CMS-pages works perfectly, yes. But the reason I'd need this change is another.
|
You were never supposed to abuse the
PS: I never understood why you opted to reinvent the wheel instead of extending the existing CMS, but that's none of my business. |
self::getActiveRequest()->getPageID()
will check the meta data for a page id before it searches the first match of the controller's classname.This is also used by the BoxHandler, so it seems to be inconsistent in it's handling. In some special cases (in my case it's a Fireball-Page) the BoyHandler will return a valid page id and assigns the boxes correctly while this method returns null or the first match which is wrong in the most cases.
This change would improve the page-mapping and should not have any unwanted side-effects.
In a nutshell: You can shorten the whole method to
because it covers both look-ups the method contains (before this commit).