Problem/Motivation
Pathauto has a patch from #936222-195: Merge in pathauto_persist module functionality to prevent losing manual aliases with node_save() calls applied, which implements hook_entity_load(). Fieldable-Panels-Panes, in turn, saves the target of a fieldable_panels_pane's link to a property named path.
This causes an issue because when a fieldable_panels_pane is loaded, pathauto's hook runs and replaces the string in the path property with an array. This prevents fieldable_panels_panes from linking to other pages.
Proposed resolution
The ideal solution would be for #1860486: Convert the path property to a field so it can be translated to be completed and added as a patch. However, a stop-gap measure can be added in the meantime to make pathauto's entity_load hook fail-fast when given a fieldable_panels_pane.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | fieldable_panels_panes-n2494733-13.patch | 2.74 KB | damienmckenna |
| #10 | fpp-n2494733-10.patch | 576 bytes | damienmckenna |
Comments
Comment #1
t0xicCode commentedComment #2
dsnopekThanks for the bug report!
Can you provides steps to reproduce on a vanilla Panopoly install? I'm not really sure what this means. How would you use FPP to link to other pages?
Comment #3
t0xicCode commentedI can't seem to replicate it on a clean website, but it's happening on one of our client's sites. I'm going to investigate in more details.
Comment #4
lunazoid commentedWe just encountered this as a result of upgrading to php 5.6 from 5.3 (it actually seems to come into play with php 5.4.) Like @t0xicCode, I couldn't replicate it on a fresh install, but on an existing site, the title will only link to the current page (even though the saved path is correct.) Going back to edit the panel shows the path as '1'.
Comment #5
lunazoid commentedAs I mentioned in #1860486: Convert the path property to a field so it can be translated, the patch seems to fix FPP. Hopefully it will get committed!
Comment #6
t0xicCode commentedTo add to my original comment, this occurred when we upgraded a website from a server running php 5.3 to one running 5.5. Seems to me like php internal handling type conversions from string to array have changed, which caused this issue.
Comment #7
chaps2 commentedWe've also seen this after an upgrade to PHP 5.6.
To reproduce (assuming you have pathauto and fieldable panels panes installed and configured):
1. Create a panel page.
2. Add a fieldable panel pane to it.
3. In the pane edit form, check the "Make title a link" checkbox.
4. Enter a node path in the textfield labelled "Path" that is revealed (possibly needs to be a node path that is covered by a pathauto pattern).
5. Save the pane and the panel.
6. Viewing the page you can see that the path that is linked to form the pane title has it's first character replaced with a 1 - e.g. node/1 would be 1ode/1.
Comment #8
damienmckennaSounds like a bug in Fieldable Panels Panes, so lets move it over there.
Comment #9
damienmckennaComment #10
damienmckennaStep 1: add a test dependency on Pathauto.
Comment #12
damienmckennaCommitted. On to step 2 - write tests to confirm what happens.
Comment #13
damienmckennaThis patch covers the scenario described above. If the test fails then the error exists. If the test does not fail then the problem is most likely in another module.
Comment #15
damienmckennaCommitted. Ok, please let me know if there are other steps we need to add to the test.
Comment #16
dsnopek@DamienMcKenna: Can you enable testbot to test with PHP 5.6? According to the people experiencing the bug above, this only happened on 5.6, but the testbot is testing on 5.3.
Comment #17
damienmckenna@dsnopek: Check the Automated Testing page, it shows that 5.6 passes ok: https://www.drupal.org/pift-ci-job/481209
If there are additional scenarios or dependencies to trigger this problem, please let me know and I'll be happy to improve the tests.
Comment #18
damienmckennaFollowing up from a chat in IRC.
If anyone is still experiencing this problem, please: a) make sure you have the latest Pathauto release, b) have the latest FPP dev release, c) identify the exact steps necessary to trigger the problem. If you still have the problem then please provide a list of the other modules installed on your site, there may be something else interfering with FPP & Pathauto. If someone can help identify the cause then I'll be happy to continue working on fixing the problem.
Comment #19
dsnopekSo, after my investigation yesterday, I found that it's a problem with PHP 5.6 and an out-dated version of the Pathauto patch for #936222: Merge in pathauto_persist module functionality to prevent losing manual aliases with node_save() calls - particularly, the version of the patch currently used in Panopoly. The patch ultimately committed to Pathauto and released as part of Pathauto 1.3 doesn't exhibit this problem, so I've been working on getting that version into Panopoly:
#2597273: Update to Pathauto 1.3
Personally, I think this issue can be closed! It might even make sense to move it back to Panopoly, since it's a patch that Panopoly included that's at fault, and it'll be easier for the affected users (ie. Panopoly users) to find it
Comment #20
damienmckenna@dsnopek: Thanks for digging into the bug, I'm glad to hear a simple module update resolves the problem!
Moving to the Panopoly queue per suggestion to make it easier to find.
Comment #21
dsnopek