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.
In testing the module, I've discovered that I must be logged in as User #1 to add a flat rate service or edit an existing one. As a result, even if I'm logged in as an administrator with all Drupal permissions (who isn't User #1), I don't see the "Add a flat rate service" local task on the "Shipping services" page or the "edit" link next to the particular service.
--Ben
Comment | File | Size | Author |
---|---|---|---|
#4 | commerce_flat_rate.fix_perms_1349024_04.patch | 1.54 KB | rfay |
#3 | commerce_flat_rate_permissions-1349024-3.patch | 778 bytes | rupertj |
Comments
Comment #1
3rdLOF CreditAttribution: 3rdLOF commentedWeird....I am having this exact problem and I am user 1. I cannot see the this none of these options for neither the UPS nor the Flat Rate modules. I have uninstalled and reinstalled them to no avail.
Using 7.2 fork with latest UPS and Flar Rate modules.
Comment #2
rupertj CreditAttribution: rupertj commentedI've got this issue too. It's because the menu callbacks for add/edit/delete on flat rate services rely on a permission 'administer flat rate', which doesn't seem to be defined anywhere.
Comment #3
rupertj CreditAttribution: rupertj commentedHere's a patch that adds a hook_permission to the flat rate module, so users can grant the required permission to administer shipping services.
Comment #4
rfay#3 is fine if it's actually necessary to add another permission. I can't really see why administering flat rate should be different from administering shipping in general. So this is an alternate patch, which just uses the permission 'administer shipping'. This is catching a lot of people though, so we should get one of these in there.
Comment #5
rfayMarking critical as it's causing a WTF for about half the people who try this.
Comment #6
rupertj CreditAttribution: rupertj commentedrfay's patch in #4 looks good to me. Simplifying the permissions makes sense too, IMO.
Comment #7
jonaflatooni CreditAttribution: jonaflatooni commentedI am pretty new to applying patches and would very much like to use this flat rate shipping as the method for a website we are trying to launch within a week. Is there any way someone could send me a patched .module file so I can just upload the file without messing up with the patching process. jonaflatooni@gmail.com if anyone could lend a hand!
Comment #8
rfay@jonaflatooni you have options... you can just live with user 1 doing the editing for now. Patching is worth learning; http://drupal.org/project/patch
Comment #9
jonaflatooni CreditAttribution: jonaflatooni commentedHi yep agree patching would be worth learning. I think I will have to go that route because even user 1 on my installation does not see the add flat rate link under store/config/shipping. Would you be able to show me what the patched module file actually looks like so that I can make sure I am editing it correctly?
Comment #10
jonaflatooni CreditAttribution: jonaflatooni commentedI actually can now see that add flat rate option for user #1. I believe I uploaded the version of flat rate that works in conjunction with 7.1 shipping instead of 7.2. Thanks for the help though.
Comment #11
rszrama CreditAttribution: rszrama commentedI took a hybrid approach; I've added an 'administer flat rate services' permission and then used a custom callback for Flat Rate configuration that accepts either 'administer shipping' or 'administer flat rate services' for the operations. This will let you restrict what aspects of the UI different types of administrators need to see (though I can't really imagine many scenarios where you should be able to add flat rate services and not configure their Rules components... I see it more as a way to segment the UX).
Commit: http://drupalcode.org/project/commerce_flat_rate.git/commitdiff/4e2a0c6