Closed (fixed)
Project:
Ubercart Addresses
Version:
7.x-1.0-alpha2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
19 Apr 2013 at 16:42 UTC
Updated:
30 May 2013 at 07:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
megachrizFrom which version did you upgrade?
All three noted situations should work, but that gives me an idea of where to look to reproduce the issue.
A possible fix would probably be to check if the update is somehow already done, but first I'd like to reproduce the issue.
Comment #2
VanessaM commentedfrom 6.28 to 7.22
Comment #3
megachrizSorry, I meant from which specific version of Ubercart Addresses did you upgrade?
Did you upgrade directly from Ubercart Addresses 6.x-1.0, for example? Or did you upgrade from Ubercart Addresses 6.x-1.0, but first upgraded to Ubercart Addresses 6.x-2.0-beta1 and then to 7.x-1.0-alpha2? Or did you, for example, upgraded from Ubercart Addresses 6.x-2.0-alpha2 and had Ubercart Addresses 6.x-1.0 never installed?
I'd like to know the specific upgrade path you took, so I can easier try to reproduce the issue.
Comment #4
VanessaM commentedHi,
I upgraded from Ubercart Addresses 6.x-1.0 to 7.x-1.0-alpha2
Comment #5
megachrizIt took a while till I get back to this, but I've been able to at least reproduce the error! At first glance, this error seem to have caused by an earlier failed upgrade at the time the module was not enabled. I think the cause of the earlier failed upgrade is because Ubercart Addresses is trying to set default uc_addresses permissions for the authenticated user (because uc_addresses 7.x-1.x introduces some new permissions) and that probably fails when the module is disabled (technical: in the upgrade function a call to
user_role_grant_permissions()is made).I need think about how to fix this problem. Thanks for reporting. :)
Comment #6
megachrizAttached are two patches: one with the automated test only and one with the fix + the test.
The patch that contains the fix inserts the default permissions directly instead of calling the API function for it, since calling that function resulted into a failing upgrade. It appears to be that setting permissions for disabled modules doesn't work with
user_role_grant_permissions(). See also #737816: user_role_grant_permissions() throws PDOException when used with non-existent permissions (e.g. a permission for a disabled/uninstalled module).Comment #8
megachrizI don't quite understand what went wrong during these tests on qa.drupal.org. In the tests I have now moved the uc_addresses table (6.x-1.x style) creation to a separate file, just as is the case for the uc_store tables that are created during the upgrade test.
New try. The first patch contains the test only and should fail tests. The second patch contains the test + the fix. I have nothing changed in the fix, only the contents of the test changed.
Comment #9
megachrizI should have included the info-file in the tests-only patch.
Again, first patch should fail tests, second should pass.
Comment #10
megachrizCommitted #9.