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.
After upgrading this module from 6.x to 7.x the function _autoasignrole_get_page_query() on line 315 was looking for a 'rids', but the name in the database was 'rid'
I deleted the 's' and it now shows no more errors.
Comment | File | Size | Author |
---|---|---|---|
#7 | authassignrole-upgrade-from-version-6-to-7-2326029-7.patch | 1.77 KB | mike.davis |
Comments
Comment #1
mike.davis CreditAttribution: mike.davis commentedHi, I think that this is a bit of a false positive.
The database structure has changed between versions 6 and 7. Currently there isn't an update script which upgrades the database table structure from the 6 version to the 7 version.
If you would like to have a go at writing the database update for this structure change and submit a patch then I will gladly review it for inclusion in the 7 version.
Comment #2
MaskOta CreditAttribution: MaskOta commentedThanks for warning me.
Ill see what i can do, but this might be out of my league.
Comment #3
jippie1948 CreditAttribution: jippie1948 commentedI did not have problems upgrading van D6 to D7.
I reinstalled the beta-1 version and the problem disappeared...
Best wishes, JP
Beta-3 works fine! Thanks.
Comment #4
luxpir CreditAttribution: luxpir commentedThanks MaskOta, mike.davis. Not sure about a decent solution to this, but a workaround after updating was to change lines 95 and 318 from 'rids' to 'rid' in sites/default/contributed/autoassignrole/autoassignrole.module (not the sites/all/modules version I've ended up with).
Site in question was an upgrade from 6 to 7, but plenty of updates later this is the first time I've noticed an issue of this kind.
Running beta-2 now, all seems OK.
Comment #5
mike.davis CreditAttribution: mike.davis commentedThanks for your comments and glad that you are able to upgrade without any major issues.
In order for a 'correct' upgrade path, the install scripts could cater for the database schema change that has happened, so this would be the most sensible route to go down.
If any of you are up for it, please have a go at adding this database schema & data migration.
Comment #6
JohnM2 CreditAttribution: JohnM2 commentedI have just upgraded from version 7.x-1.0-beta 1 to 7.x-1.0-beta 2 and started to receive error messages about the 'rid' field being missing. This looks like the same issue that has already been reported. If I return to 7.x-1.0-beta 1 the error goes away. I have bumped this to major as there are clearly problems with the upgrade from 7.x-1.0-beta 1 to 7.x-1.0-beta 2.
Comment #7
mike.davis CreditAttribution: mike.davis commentedHi @JohnM2, here is a patch for updating the database schema from the table in version 6 to the table in version 7 and moving the data to the new format.
Please make sure that you have backed up your database before running this script as this will take the data from the old table format, delete it and recreate the table in the new schema before adding the data back in in the correct format.
If you have any doubts you can just backup the specific table using the following drush command: drush sql-dump --tables-list=autoassignrole_page --result-file=autoassignrole_page.sql.
This will create an SQL file in the directory that you are in called autoassignrole_page.sql with just that table backed up.
If this works correctly and everyone is happy with it then I can get this committed and a new beta release created.
Comment #8
mike.davis CreditAttribution: mike.davis commentedThis has been committed so that this doesn't become a blocker