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'm not sure which module this issue is caused by, but here goes:
My client is complaining that when nodes are published, sometimes images (using image field) are going missing for the extra languages (default language retains the images).
The fields are set to 'unlimited values', and are translatable using entity translation. Im trying to recreate the problem, but have unable to yet, but I believe that the problem exists, as there are sometimes images missing before they manually upload them again.
Any idea what could be causing this?
Comments
Comment #1
mrchristophy CreditAttribution: mrchristophy commentedComment #2
pfrenssenI have no idea honestly. Scheduler publishes nodes using the standard
node_publish_action()
action, which just sets$node->status
toNODE_PUBLISHED
. This shouldn't affect image fields on translations.Maybe you can look which modules also act on publication or saving of nodes? Disappearing images could also be because the images are not marked as permanent in the database, then they get cleaned up in
system_cron()
during cron runs. This might occur during the same cron runs in which Scheduler publishes the nodes, giving the impression that it is related to scheduled publishing. To prevent this the images need to be manually marked as permanent withfile_usage_add()
.Can you perhaps inspect the images in the database to see if they are all marked as permanent?
Comment #3
pfrenssenClosing for lack of activity. If this is still an issue, feel free to reopen and provide some additional information.
Comment #4
peterg.griffin CreditAttribution: peterg.griffin commentedI'm having some issues with this as well. Not sure why images do not appear after running the cron and node being published, but clearing the cache brings the images.
Some additional info that might help:
Drupal 7.51
Media 7.x-2.0-beta2
CKeditor 7.x-1.17
Scheduler 7.x-1.5
Happens only when adding images to body field and setting node to publish with scheduler. Otherwise the image is displayed correctly.
Comment #5
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedHi Peter,
Thanks for the further details, and the information that the images return after clearing the cache. As Pieter explained in #2 we are only using the standard
node_publish_action()
but I think I have seen in some other issue where a 3rd-party module was also reacting to a node being updated in cron and it appeared (incorrectly) that Scheduler was the cause of the problem.I will try to replicate this using the modules you have mentioned.
Setting the issue to 'active' as there is no patch here yet which 'needs work'
Jonathan
Comment #6
peterg.griffin CreditAttribution: peterg.griffin commentedHi Jonathan!
My problem was actually caused by the images not having the correct url, probably just due to not setting the $base_url. My fix was actually just that and now it has been working fine. Anyway, thanks for the help!
I think the issue I had has nothing to do with this module, I'll set this as works as designed (change it if needed). And btw, thanks for the great module!
// Peter
Comment #7
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedPleased to here it is OK now. Thanks for the reply.
Jonathan