Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The patch applied to pathauto has some issues. One consequence is that nodes created programatically or using Feeds module, don't get any path aliases set.
A newer patch in the issue solves that problem: #936222: Merge in pathauto_persist module functionality to prevent losing manual aliases with node_save() calls
Comment | File | Size | Author |
---|---|---|---|
#9 | panopoly_core-pathauto-1979558-9.patch | 1.25 KB | dsnopek |
#4 | 1979558-panopoly-core-update-patch-4.patch | 1.09 KB | beeradb |
#3 | 1979558-panopoly-core-update-3.patch | 1.09 KB | hefox |
#2 | 1979558-panopoly-core-update-2.patch | 547 bytes | hefox |
panopoly_core-pathauto-patch-update.patch | 533 bytes | Xen |
Comments
Comment #1
PanchoMoving this to the main Panopoly queue.
Looks good!
Comment #2
hefox CreditAttribution: hefox commentedPatch been updated
Comment #3
hefox CreditAttribution: hefox commentedNeed to make sure te latest pathauto update function has run (safe to rerun - for those running the earlier patch).
Comment #4
beeradb CreditAttribution: beeradb commentedHere's a re-roll to remove https in the .make, which is discouraged.
Comment #5
brandenlhamilton CreditAttribution: brandenlhamilton commentedAs an aside, the above patch to pathauto cannot be used as-is for existing Panopoly users. The previous patch that Panopoly appled (https://drupal.org/files/936222-pathauto-persist.patch) to pathauto is not compatable with this patch. Specifically, this patch defines the pathauto database table as 'pathauto_state' while the previous patch used 'pathauto'. Similarly, the update hook in the original patch uses the same update number (pathauto_update_7006).
I'm still looking into what's needed here, but I suspect that the cleanest option is to disable and uninstall pathauto and reinstall it with the new patch, nevertheless, that has it's own drawbacks.
Comment #6
hefox CreditAttribution: hefox commentedbrandenlhamilton: look at patch 4 o.O
Comment #7
brandenlhamilton CreditAttribution: brandenlhamilton commented@hefox, my apologies, my last post should have had the link to the patch in the fourth post. My intention was to bring attention to the fact that if you're already using Panopoly, you are using an alternative patch that already defines a Pathauto schema that isn't necessarily compatible with the patch in #4.
In my case, I was running into PDO exceptions expecting the new schema defined in #4, pathauto_state, when attempting either run update.php or drush updb. My suspicion is that pathauto_entity_state_load_multiple() is called before hook_update_N has had a chance to update {pathauto} to {pathauto_state}.
Comment #8
dsnopekI agree that this patch is super important. Thanks to @Xen, @hefox, @beeradb and @brandenlhamilton for working on getting it into Panopoly!
I have a number of existing production sites on Panopoly and I share @brandenlhamilton's concerns about the upgrade path, so I just did the following test:
drush updatedb
It runs fine, meaning there are no errors. However, the state data that was previously saved to the {pathauto} table is gone! It no longer knows that I manually set the alias on the node I created.
I'll try to put together a patch that preserves the data...
Comment #9
dsnopekNew patch attached which will preserve existing state that was stored on the {pathauto} table. Please let me know what you think!
Comment #10
populist CreditAttribution: populist commentedThanks so much everyone for the work here. That issue #936222: Merge in pathauto_persist module functionality to prevent losing manual aliases with node_save() calls is such a pain and glad its almost committed and the upgrade path for Panopoly folks is clear.
I did some basic tests and stuff was good. Committing now and will test the upgrade path on a few sites.
Comment #11
dsnopekAwesome, thanks!
Comment #13
seanrThe patch in #9 causes a fatal error on updb:
The actual signature of that function is pathauto_update_7006(&$sandbox) - so we need to pass in a $sandbox variable. Even after fixing that, however, it still doesn't find the needed table and throws a SQL error:
So what went in is very broken and needs to be revisited.
Comment #14
dsnopekHmm. Looking at the patch:
https://drupal.org/files/pathauto-persist-936222-130-pathauto-state.patch
The signature of the function is NOT pathauth_update_7006(&$sandbox).
Also, I used this update on two live production sites some time ago and it worked fine. I was able to verify in the database that the entries got moved to the new table and everything. I'm not sure how our pathauth modules could be so different...
Comment #15
dsnopekActually, looking at the old patch - the signature is pathauth_update_7006(&$sandbox)! Is it possible that you're using the new panopoly_core but didn't run panopoly_core.make to get the new dependencies with the new patches? If the new patch gets applied to the pathauto module, this will work!
Comment #16
populist CreditAttribution: populist commentedI have seen these errors as well and this def should be fixed. That pathauto issue is just ridiculous and hope we can get it solved soon.
Comment #17
seanrdsnopek, you'll encounter this if you upgrade via drush up rather than doing a whole rebuild.
Comment #18
hefox CreditAttribution: hefox commentedseanr: I believe what people are saying that that is not not a supported workflow for modules provided by a distro, as it means distros are unable to apply their patches to said modules, etc.
Sounds like this can be set to fixed again?
Comment #19
dsnopek@seanr: What @hefox said ;-) - you shouldn't be upgrading distros with drush up. A newer version of a distro can include new patches and/or may require you to stay on a specific version of a module (not go to the newest available like drush up will do). All of this is defined in the *.make files which you need to build from. So, I'm going to mark this as fixed again.
Comment #20
fredeee CreditAttribution: fredeee commentedhi
gave up and uninstalled panopoly core for the time being.
Comment #20.0
fredeee CreditAttribution: fredeee commentedAdded a link to the original issue in the pathauto queue.
Comment #21
aalamaki CreditAttribution: aalamaki commentedExperiencing similar issues as mentioned in #13. In our case, the scenario is that we are updating from Panopoly 7.x-1.0-rc3 to the rc5.
It appears that Panopoly rc3 has the patch http://drupal.org/files/936222-pathauto-persist.patch applied to the Pathauto whereas the latest rc5 is applying http://drupal.org/files/pathauto-persist-936222-130-pathauto-state.patch.
This causes the errors on updb because the installer file has a different database schema but no update path between them, in the first patch it has $schema['pathauto'] and in the second one $schema['pathauto_state'].
The issue here the pathauto_update_7006() function checks for pathauto_persists table and moves data from it to the pathauto_state table but it does not check if there is a table "pathauto" and move data from that to the new table, this causes the errors on drush updb.
Will provide a patch for this before the xmas if I have time.
Comment #22
aalamaki CreditAttribution: aalamaki commentedAppears that the patch at http://drupal.org/files/pathauto-persist-936222-130-pathauto-state.patch has at least one "weirdness"; it is setting entity_id to varchar (255) whereas entity id is always numeric, means that column should be numeric as well, in the older patch it was correctly set to unsigned int. Investigating this further tomorrow.
Comment #23
aalamaki CreditAttribution: aalamaki commentedSwitching discussion to the original issue queue at https://drupal.org/node/936222.