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.
I installed latest DEV version and getting the following error on all /user pages:
Warning: Missing argument 2 for commerce_addressbook_profile_page_access() in commerce_addressbook_profile_page_access() (line 151
Notice: Undefined variable: profile_type in commerce_addressbook_profile_page_access() (line 155
I think error is caused by missing access argument $type in commerce_addressbook_menu user/%user/addressbook.
Comment | File | Size | Author |
---|---|---|---|
#8 | addressbook_menu_issues-1540624-8.patch | 3.52 KB | vasike |
#5 | addressbook_menu_issues-1540624-5.patch | 3.48 KB | vasike |
#4 | addressbook_menu_issues-1540624-4.patch | 6.5 KB | vasike |
Comments
Comment #1
Christopher Riley CreditAttribution: Christopher Riley commentedI am running into the same issue on a fresh install.
Comment #2
vasikei can confirm this issue and i think this a critical one.
should be checked/tested on a clean install.
there, in the (addressbook menu items definition and their callback functions) 2 issues:
1. the missing argument for the
solution proposal to use the "billing" as default argument for the customer profile type.
a. could be in the menu item definition
or
b. in the functions definition for profile type argument.
Or
c. create a new helper function with somthing similar as user_page() function
2. Access callback functions for the addressbooks have
i can't find such variable. maybe this is something old remained there.
without this variable we'll have Access denied for all addressbook pages.
So is this variable check still a valid one?
Comment #3
bojanz CreditAttribution: bojanz commentedThe variable check is fine.
Note the code in hook_menu() that's supposed to add the second argument:
This code doesn't execute, hence the fail. Find out why.
Comment #4
vasikethe source of this issue is no profile addressbook enabled.
here is a patch that should build the right menu items only for profile types with addressbook enabled.
but it doesn't look so good for me. as it requires menu to be rebuilt for any enable/disable the addressbook.
i'm thinking about having different approach (instead of hook_menu) for the user addressbook pages.
To have a display for disabled and profiles views for the enabled ones.
The only issue in this case is which should be the default/first (for $items['user/%user/addressbook']).
Comment #5
vasikethe current $items['user/%user/addressbook'] menu items doesn't provide a solution if we have no addressbook enabled.
it will also not work if we disable all the addressbooks (initially enabled).
this menu item it's built depending on a presumed profile type with addressbook enabled.
i built a patch that redefines this menu item, which calls new page and access callbacks functions, profile type independent.
the access callback return the first profile type with addressbook enabled if any or FALSE.
using this type will return with the page callback the addressbook profile page.
this patch moves the logic from menu building to menu item access callback as we have for every profile type addressbook.
Comment #6
TimelessDomain CreditAttribution: TimelessDomain commentedpatch #5 fixed the error for me. thanks!
Comment #7
krisrobinson CreditAttribution: krisrobinson commentedI can confirm patch from #5 fixed this error on my fresh install.
Comment #8
vasikeit seems there's still an issue with the 'user/%user/addressbook' menu item.
#1804790: Address Book issue, admin can't view users' address book!
here is the updated patch.
Comment #9
jsacksick CreditAttribution: jsacksick commentedCommited to dev, thanks.
Comment #11
wc_anwar CreditAttribution: wc_anwar commentedthe dev version still provides the unpatched version.
Comment #12
jsacksick CreditAttribution: jsacksick commentedThe patch has been applied, http://drupalcode.org/project/commerce_addressbook.git/blob/refs/heads/7...
Comment #13
bojanz CreditAttribution: bojanz commented