-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Parse preprocess rules from component routers #8986
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
Conversation
the parse preprocess rules added from component's routers
The getComponents method loads all installed components
|
Replaces #8801 |
|
I have tested this item ✅ successfully on 27802e7 Tested in com_content/router.php class ContentRouter extends JComponentRouterBase This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8986. |
|
|
||
| // Set the parsepreprocess components methods | ||
| $components = JComponentHelper::getComponents(); | ||
| foreach ($components as $component) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codestyle dictactes we need an empty line before the foreach.
|
I have tested this item ✅ successfully on 27802e7 class UsersRouter extends JComponentRouterBase //test } This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8986. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8986. |
|
@alexva24 cloud you fix code style and since tag, please. |
|
@rdeutz it is prepared here: https://github.com/joomla/joomla-cms/compare/staging...zero-24:alexva24?expand=1 you can merge than i open the CS / @SInCE version PR for you to merge. |
fix cs and merge staging
* re-arrayhelper-min: (2467 commits) Minimize JArrayHelper methods `toInteger`, `pivot`, `arrayUnique` by using Joomla\Utilities\ArrayHelper internally. Leaving (reverting from joomla#7782) other four methods as is for b/c reasons as mentioned in joomla#8455. remove platform include (joomla#11615) [GitHub Templates] Make headings bigger (joomla#11607) [com_contact] Make ACL core.edit.own work (PR for 11466) (joomla#11503) Small review on docs & code structure in JModelLegacy library classes (joomla#11057) Obviously, this should be an array. (joomla#11610) Don't manually import JPlatform anymore (joomla#10841) Parse preprocess rules from component routers (joomla#8986) Add the correct exception after 11593 merge (was waiting for that merrge) (joomla#11606) Add missing clean line after joomla#9277 (joomla#11605) Deprecate the _PROFILER global var (joomla#10845) Spelling errors (joomla#11604) Moved travis javascript bash file to build/travis like joomla#11600 (joomla#11603) Regression: Fix edit check in backend articles manager, always denying edit after soft deny (joomla#11511) [com_plugins] User not allowed to core.manage? Use 403 php custom exception (instead of a 404 JError) (joomla#11593) [com_newsfeeds] Make ACL core.edit.own work (PR for 11466) (joomla#11502) $result-variable-undefined-given-default-value (joomla#9277) com_banners use exceptions. and not allowed is a 403 (joomla#11418) Frontend & plugins using the autoloader (joomla#10882) New version of PR 6788 (JText::_() Optimizations) (joomla#11235) ...
* the parse preprocess rules added the parse preprocess rules added from component's routers * getComponents method added The getComponents method loads all installed components * CS fIx CS fox for joomla#8801 * CS for helper.php * cs & deploy version
* the parse preprocess rules added the parse preprocess rules added from component's routers * getComponents method added The getComponents method loads all installed components * CS fIx CS fox for joomla#8801 * CS for helper.php * cs & deploy version
|
I think there is a problem with using "JComponentHelper::getComponents()". |
|
Could someone please correct the Milestone 3.7.0? This PR was merged in Joomla 3.6.3. Thank you! |
|
With xmap installed and on Joomla! 3.6.2 works fine, Joomla! 3.6.4 we get syntax error, unexpected '$items' (T_VARIABLE) Because this change was pulled in on 3.6.3. Whilst I appreciate it's likely bad outdated coding in xmap. A lot of sites use xmap and we will now be taking them down with this change :-/ Many thanks |
where? is that line? |
|
Sorry! Error reports It was caused at line 123 of I'm just downloading an older backup to try and produce a server to replicate it on since the site was live I just removed xmap completely. |
|
looks like an old or hacked version see: https://github.com/joomla/joomla-cms/blob/3.6.4/libraries/cms/router/site.php#L123 |
|
No, that is the same file. I replaced the parse function completely with the version from 3.6.2 to debug it and did an output of the option on the foreach loop. noticing it produced a fatal after com_xamp was loaded with the 3.6.3 site.php router file. I'll debug further and let you know the outcome. |
|
Please open than a new bug report with all needed information. Commenting on a closed / merged PR get missed fast. ;) |
|
Isn't xmap abandoned now?
|
|
Yep, but a normal user wouldn't have a clue or know anything about their xmap version since it's not shown in the updater if it's of a certain version. The fact the site works fine on 3.6.2 but the 3.6.4 update breaks the site is my point, an incremental version is breaking things regardless of how it should be done. Anyway I'll debug and open a new issue. |
|
Sorry to say this, but this change is pretty horrible. It loads all components, regardless of them even having a frontend part, and then does lots of checks, only to fail for most components and then creating legacy routers for those. And that is why the site of a customer of mine instantiates 57 router objects in the frontend and sites with xmap fail after this "feature". And all of that because one dev didn't want to create a plugin for his special parseing code. 😠 |
|
Please open than a new bug report with all needed information. Commenting on a closed / merged PR get missed fast |
|
I know that, but since this has been released, there is nothing that we really can do. This is now out in the open and we have to wait for Joomla 4.0 to fix this. Coincidentally, this did not survive the changes for the 4.0 router. So, an unsolvable bug for 3.x that has been fixed in 4.0. I just wanted to document that this is a stupid idea in the hopes that future generations stumble upon this and make wiser decisions. |
The aim of this PR is providing possibility to execute custom component's parse preprocess rules instead develop onAfterInitialise plugin.
For testing you should create parsepreprocess method on router of any installed components. The method will be executed on 593 line /libraries/cms/router/router.php