Skip to content

Conversation

@alexva24
Copy link

@alexva24 alexva24 commented Jan 26, 2016

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

Aleksey Vaganov and others added 5 commits December 28, 2015 11:23
the parse preprocess rules added from component's routers
The getComponents method loads all installed components
CS fox for #8801
@wojsmol
Copy link
Contributor

wojsmol commented Jan 26, 2016

Replaces #8801

@anibalsanchez
Copy link
Contributor

I have tested this item ✅ successfully on 27802e7

Test OK.

Tested in com_content/router.php

class ContentRouter extends JComponentRouterBase
{
public function parsepreprocess() {
die;
}


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)
Copy link
Contributor

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.

@Curiensol
Copy link

I have tested this item ✅ successfully on 27802e7

Tested in components\com_users\router.php @icampus Pizza, Bugs & Fun

class UsersRouter extends JComponentRouterBase //test
{
public function parsepreprocess() {
echo "Working!";

}


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8986.

@brianteeman
Copy link
Contributor

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8986.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 2, 2016
@rdeutz rdeutz added this to the Joomla 3.7.0 milestone Aug 14, 2016
@rdeutz
Copy link
Contributor

rdeutz commented Aug 14, 2016

@alexva24 cloud you fix code style and since tag, please.

@zero-24
Copy link
Contributor

zero-24 commented Aug 14, 2016

@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
@rdeutz rdeutz merged commit 9df98b7 into joomla:staging Aug 15, 2016
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 15, 2016
@zero-24
Copy link
Contributor

zero-24 commented Aug 15, 2016

Thanks @alexva24 and @rdeutz

izharaazmi added a commit to izharaazmi/joomla-cms that referenced this pull request Aug 15, 2016
* 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)
  ...
ggppdk pushed a commit to ggppdk/joomla-cms that referenced this pull request Aug 19, 2016
* 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
roland-d pushed a commit to roland-d/joomla-cms that referenced this pull request Sep 11, 2016
* 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
@vinespie
Copy link
Contributor

I think there is a problem with using "JComponentHelper::getComponents()".
Static method "load" in class "JComponentHelper" get all components even those who discover.

@ghost
Copy link

ghost commented Oct 22, 2016

Could someone please correct the Milestone 3.7.0? This PR was merged in Joomla 3.6.3. Thank you!

@tonypartridge
Copy link
Contributor

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
Tony

@zero-24
Copy link
Contributor

zero-24 commented Oct 25, 2016

syntax error, unexpected '$items' (T_VARIABLE)

where? is that line?

@tonypartridge
Copy link
Contributor

Sorry! Error reports It was caused at line 123 of
/libraries/cms/router/site.php

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.

@zero-24
Copy link
Contributor

zero-24 commented Oct 25, 2016

@tonypartridge
Copy link
Contributor

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.

@zero-24
Copy link
Contributor

zero-24 commented Oct 25, 2016

Please open than a new bug report with all needed information. Commenting on a closed / merged PR get missed fast. ;)

@brianteeman
Copy link
Contributor

brianteeman commented Oct 25, 2016 via email

@tonypartridge
Copy link
Contributor

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.

@Hackwar
Copy link
Member

Hackwar commented Aug 23, 2018

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. 😠

@brianteeman
Copy link
Contributor

Please open than a new bug report with all needed information. Commenting on a closed / merged PR get missed fast

@Hackwar
Copy link
Member

Hackwar commented Aug 26, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.