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.
Comment | File | Size | Author |
---|---|---|---|
#15 | uc_recurring-1937840-node_access_notice-15.patch | 2.8 KB | Les Lim |
#14 | uc_recurring-1937840-14.patch | 1.89 KB | univate |
Comments
Comment #1
DanZ CreditAttribution: DanZ commentedYou appear to be using some sort of node access control module. Which one? Have you tried its issue queue?
What are you doing with those product pages? Just viewing them? What happens if you look at a catalog display listing numerous product pages?
The error is happening on
$node->nid
. The nid value should always be defined except when creating a new node, so there is somehow corrupt data here.Try installing the devel module and getting a backtrace from that on this error. It should show you what part of the code is messing up. It's quite possibly not related to Ubercart.
Check your permissions to make sure that anonymous users can view all content that they should be able to view. You probably have some sort of content on your product pages that they can't view.
Comment #2
G Gavitt CreditAttribution: G Gavitt commentedI am seeing similiar behavior on a new site with just the modules needed to run the cart and order modules. I see the same notice for logged in users and anonymous users.
I found a related issue and a patch for the entity api module (required for cart and order). http://drupal.org/node/1780646#comment-703044. That fixed the same issue I was having for all nodes but it did not fix it for ubercart product nodes.
I did notice that the product module calls the arguments to hook node access in the wrong order.
Line 159 uc_product_module
function uc_product_node_access($op, $node, $account) {
where according to http://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook...
It should be $node then $op. I switched the order in uc_product_module but the same notice still appears.
The weird thing is that older versions of uc_product_module do the same thing with the argument order and I have not seen this notice before. I will have to check which versions of the required modules I am using on this older install.. I am assuming its a combination of the newest versions of the required modules and the newest version of ubercart that make this notice appear.
Comment #3
goldlilys CreditAttribution: goldlilys commentedI haven't added any node access control modules. The product pages showed up fine without any errors before the upgrade so it's not a problem with the permissions access.
Tested out more what other possible modules of ubercart could be causing it and for some reason when I removed the Subscription Manager module for recurring fees, the error disappeared. Not really sure how to use backtrace in devel, do I just add that to the template for product pages?
Comment #4
G Gavitt CreditAttribution: G Gavitt commentedSorry to confuse the issue.. I had the uc_recurring_subscription.module installed as well.
I traced it back to the uc_product_edit_access function in the product module. That function is called from
the uc_recurring_subscription.module. It has a menu item that uses the uc_product_edit_access function for an access callback.
Commenting out the menu item and clearing the cache removes the notice. Obviously its not a solution but at least I know where its coming from. I am pretty sure this is an issue for http://drupal.org/project/uc_recurring
Comment #5
TR CreditAttribution: TR commentedTry changing 'node/%/edit/subscription' to 'node/%node/edit/subscription' in the above uc_recurring_subscription module.
Comment #6
TR CreditAttribution: TR commentedAnd as a side note, all of the uc_product access callbacks are located in uc_product.module instead of uc_product.admin.inc where the menu definition says to look. That's not causing any problems, but the menu definitions should be changed. The callbacks don't belong in uc_product.admin.inc because that forces the admin include file to always load. So the menu definition is wrong.
Comment #7
G Gavitt CreditAttribution: G Gavitt commentedThat fixed the notice. Thanks TR.
Comment #8
longwaveMoving to uc_recurring queue so it can be fixed there.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commented#5 worked for me. thanks
Comment #10
jkdaza CreditAttribution: jkdaza commented#5 worked for me as well.
Thanks
Comment #11
goldlilys CreditAttribution: goldlilys commented#5 worked for me as well. Hopefully this can be changed on the next release. Thanks.
Comment #12
bmarcotte CreditAttribution: bmarcotte commented# 5 worked for me as well. I'm running the Oct-19-2013 7.2 dev version. Can we commit this?
Thanks to all!
Bob
Comment #13
Avidlearner CreditAttribution: Avidlearner commentedI got this error after a fresh install of Drupal Core 7.25 and Ubercart and configuring product classes. The fresh install of Drupal Core and Ubercart did not cause any issues. It was only after I added product classes in Ubercart that I saw this error. Also, this error was only for anonymous user. I could not regenerate the same error using an admin account.
To resolve the issue, I unchecked the "Product" module under Ubercart-Core. Another workaround would be to delete the classes that could be causing the problem.
Comment #14
univate CreditAttribution: univate commentedNeeds to be tested - but I presume that this would need the argument to the page callback to be updated here as well as the menu item?
Comment #15
Les LimVariable mismatch between $node and $product.
This looks right, but there's also a menu route for 'admin/store/subscriptions/%/edit' that needs the same change.
New patch attached.
Comment #16
Donkzilla CreditAttribution: Donkzilla commentedThis fixed it for me. YEARS after the error was discovered it's still not been fixed in the uc_recurring module I installed via drush this morning.
Comment #17
LeDucDuBleuet CreditAttribution: LeDucDuBleuet commentedThe patch in #15 although not applying cleanly against current dev, does the job once applied manually.
Thank you.
Comment #18
shahidaali CreditAttribution: shahidaali commented#5 fixed my problem