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.
Hi,
In displaysuite I created a custom field with a link for adding a flag.
But only the first one is beïng rendered?
print flag_create_link('my_flag_type', $entity->nid);
What am I doing wrong?
Comments
Comment #1
harings_rob CreditAttribution: harings_rob commentedError that shows up:
Trying to get property of non-object in flag_entity->applies_to_entity() line 124 of flag_entity.inc
Comment #2
joachim CreditAttribution: joachim commentedIt sounds like your $entity is not defined.
Comment #3
joachim CreditAttribution: joachim commentedComment #4
harings_rob CreditAttribution: harings_rob commentedHi Joachim,
I have checked this case with the following code:
The node id is rendered at every product. But the the error still pops up.
So $entity must be defined.
Comment #5
joachim CreditAttribution: joachim commentedCan you follow the code and figure out where we lose it?
Alternatively, it would probably be more productive to focus your efforts on adding support for DS to Flag as a patch. I assume from your original post that you're pasting PHP code into something?
Though, have you tried placing the Flag pseudofields that are now available in 3.x?