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.
premium_node_level_data() doesn't check to see if $node->nid exists, so you get the message
Notice: Undefined property: stdClass::$nid in premium_node_level_data() (line 319)
when you create a node (not when you edit an existing node because $node->nid is then set)
Comment | File | Size | Author |
---|---|---|---|
#12 | premium_content-1482896-12.patch | 857 bytes | pjcdawkins |
#9 | premium_content.code_.1482896-9.patch | 1.83 KB | vparfaniuc |
premium-nid-check.patch | 383 bytes | dgtlmoon |
Comments
Comment #1
dgtlmoon CreditAttribution: dgtlmoon commentedComment #2
mikl CreditAttribution: mikl commentedLooks good to me.
Comment #3
dgtlmoon CreditAttribution: dgtlmoon commentedcomitted
Comment #5
rurri CreditAttribution: rurri commentedThis patch needs some work. While it correctly causes the error message to disappear it breaks the default premium type selection for the new node.
It also hides the fact that there is a bug in the way that the value for the premium select box is being selected.
The following code seems to fix both of these problems:
Comment #6
dgtlmoon CreditAttribution: dgtlmoon commentedcan you provide as a patch?
Comment #7
Yoran Scholiers CreditAttribution: Yoran Scholiers commentedThis is still a issue, or am I wrong?
I ask this because I get the same notice when I'm creating a node.
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commented#5 fixed the problem for me, fwiw
I was getting the following errors on the add content form, but no longer there, and the premium_content level that the content type is set to default to is appearing as it should:
Comment #9
vparfaniuc CreditAttribution: vparfaniuc commentedSince the latest version of the module still has this issue, here is a patch which fixed the error on my projects
Comment #10
dgtlmoon CreditAttribution: dgtlmoon commented@vparfaniuc code style has broken indentation
Comment #11
pjcdawkins CreditAttribution: pjcdawkins commentedComment #12
pjcdawkins CreditAttribution: pjcdawkins commentedTrimmed irrelevant changes