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.
Currently have this module enabled on a forum to close topics, open topics and add tags such as [Resources] with the help of custom PHP code.
Now the flag module works fine as I need it to however, after a certain period, the buttons disappear which require me to restart the module by disabling and enabling it again.
Any possible reasons why this happens?
UPDATE: Sorry but I should have been more clear by what i mean by the buttons. (see attached image)
Comment | File | Size | Author |
---|---|---|---|
#2 | Capture.PNG | 2.12 KB | bash247 |
Comments
Comment #1
joachim CreditAttribution: joachim commentedWhat do you mean by 'buttons'?
Have you tried clearing your caches?
> to close topics, open topics and add tags such as [Resources] with the help of custom PHP code.
It sounds like you're not actually flagging anything, you're just using Flag's UI. In which case, you'd be better off with https://drupal.org/project/fasttoggle.
Comment #2
bash247 CreditAttribution: bash247 commentedComment #3
joachim CreditAttribution: joachim commentedSorry, I don't know what you're showing me. Are those views fields, or links on full entities, or something else?
Have you tried clearing your cache when it happens?
Comment #4
bash247 CreditAttribution: bash247 commentedClearing the cache doesn't solve my issue.
I am flagging nodes that trigger a certain action such as turning off commenting for a certain node and altering the title of a node.
I would also like to mention that I'm running the module in two different environments, A dev server where the module doesn't have this issue and a live server where the module is having problems. Could this possibly be server related?
Comment #5
bash247 CreditAttribution: bash247 commentedThose are the "buttons" that are created by the flag module. They are links on full entities.
Comment #6
joachim CreditAttribution: joachim commented> I am flagging nodes that trigger a certain action such as turning off commenting for a certain node and altering the title of a node.
It really sounds like you're not actually using Flag for its intended purpose, but just the UI element.
Comment #7
bash247 CreditAttribution: bash247 commented>It really sounds like you're not actually using Flag for its intended purpose, but just the UI element.
It was the only module that got the result I needed. I'm using the api within a PHP snippet that adds relevant tags to a node title when an administrator selects one of flags/buttons shown in the image I uploaded earlier.
Comment #8
joachim CreditAttribution: joachim commented> I'm using the api within a PHP snippet that adds relevant tags to a node title when an administrator selects one of flags/buttons shown in the image I uploaded earlier.
Where's the PHP snippet?
Comment #9
bash247 CreditAttribution: bash247 commented>Where's the PHP snippet?
The PHP snippet is located within a view field. It's excluded from display and then is added to the Title fields as a rewrite rule. This then displays the relevant tag to the title. Below is the PHP code.