modxbot / migrate

A testground for migrating issues and other such fun
0 stars 0 forks source link

Parser processing of static elements fails because of logic change in 2.2.9 #10211

Closed exside closed 11 years ago

exside commented 11 years ago

exside created Redmine issue ID 10211

In a quite painful bug searching activity I found out that static elements with a media source other than 0 (nothing) don't get processed right anymore. This is due the parser logic changes from Bug 10007 (http://bugs.modx.com/issues/10007 & https://github.com/opengeek/revolution/commit/779ef0581e403b8fc6e4c80f132e85174acc10f1) that were released with 2.2.9.

I suddenly had wayfinder 2.3.3 not showing subnavs anymore after a 2.2.9 upgrade. I use ElementHelper to create modx objects/elements from static files. ElementHelper assigns a media source (default 1) to the created static elements.

I started to track it down like that:

  1. Installed older wayfinder 2.3.2, no changes
  2. Installed MODx 2.2.8 with wayfinder 2.3.3 and everything worked as expected, so the 2.2.9 release seemed to be the problem, but what. Went through the changelog and eventually found bug 10007, reverted all files to the last version and see, it works again. That new setProcessingElement() method from the modparser.class.php seems to be the problem, but I don't know what exactly...

How to reproduce:

  1. Install a copy of modx 2.2.9
  2. Install wayfinder 2.3.3
  3. create 4 chunks (normally through the manger + copy/paste) nav.main, nav.main.row, nav.sub, nav.sub.row,
  4. use these chunks to display your nav (be sure you have nested resources to generate subnavs), it should work
  5. then choose any chunk, open it in the manger and tick the "static" checkbox (but don't change the media source, so it's still on 0) -> it should still show the subnav
  6. then change the media source to something else than 0, eg 1 for the filesystem, now the subnavs are gone because magically the [[+wf.wrapper]] placeholder form the inner chunks get stripped from the output.

I only observed this with wayfinder till now, but I think this could also be an issue with other extras.

opengeek commented 11 years ago

opengeek submitted:

I need to confirm that only static chunks that are failing in Wayfinder. Others are reporting similar problems with regular Chunks.

exside commented 11 years ago

exside submitted:

For more details about how I tracked down the problem, see here: https://github.com/roryg/ElementHelper/pull/16

I could track it down to static chunks because it worked with "normal" ones, at least in my case...

opengeek commented 11 years ago

opengeek submitted:

the wicked witch is dead! https://github.com/modxcms/revolution/commit/5cd13cba13e52e888cff5a5209b4d88bb976daf5