Most probably related to #1907278: missing title when used with title and entity translation modules, but with details to reproduce the issue.
So, I have tried 7.x-1.0 up to 7.x-1.2 as well as 7.x-dev and could reproduce it constantly.
Using entity_translation and title_field modules, I have a content type (News). I create a new one and set a publish date. The language I choose is different, e.g. German. Now, when publishing the node using the English URL for cron (run manually, with or without a cron-key, or using scheduler's lightweight cron) it publishes the node but the title gets removed.
I also got it to work by creating the content in English and choosing the German cron URL (i.e. http://dev.mysite.com/de/admin/reports/status/run-cron) with the same result. When running cron in the same language this problem didn't occur.
The default language for the site is English.
After debugging I found that the _scheduler_publish function loads the node but the title is NULL. I don't know if the cache is language based, but when using node_load($nid, NULL, TRUE) it worked and the title appeared correctly. I have a patch attached. I also applied this fix to the _scheduler_unpublish function too, though I haven't tested if the problem also occurs there.
Comment | File | Size | Author |
---|---|---|---|
#17 | title_missing_on_publish-2339221-17.patch | 999 bytes | J-Lee |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedAdded patch
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedCorrected path for file
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedWrong comment number in patch and swapped hypens/underscores based on the patchname suggestion.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #8
pfrenssenThis is probably not Scheduler's fault but rather the module that first populates the node_load() cache incorrectly.
Can you replicate this problem using only the Scheduler module on a clean installation? Can you perhaps debug the page request and see who does the very first call to node_load() with that node id? That will give some vital clues to the actual cause of the problem.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedHello, I can't really test it, as it takes too much time to setup a clean environment. I'm using a the title module too though, in case you missed that.
On saving the node, menu.inc from drupal_bootstrap calls it. Is it cached from then on? When running cron, the first node_load does occur from the scheduler. I found out though, calling node_load($nid, NULL, TRUE) once is not enough??? Now when calling it twice after eachother it works.
No idea what is going on here.
Comment #10
pfrenssenThis problem is likely specific to your installation. Scheduler is just using node_load() and expects it to contain correct data. For some reason it is cached incorrectly. This may be due to a number of reasons, maybe a module is altering the node when it is loaded? It could be the Title module, or perhaps some other module.
It's very hard to assist you with this, as every Drupal site has a unique configuration and combination of modules. If this was reproducible on a clean install it would be a lot easier to figure out.
If you really want to get to the bottom of the problem then the best thing is to use a debugger and "watch" the node as it is populated. This can be time consuming but as you step through the code you will see exactly what's going on and what causes the problem. You can also try disabling some modules to see if the problem disappears. That will help to narrow down the problem.
If you don't have the energy or time to dive deeply in this I can fully understand :)
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedI will see if I get to it within the next few days.
Some more details: The node array (after scheduler loads it) has a "title" (not title-field) with the value NULL and another array element called "title_original" exists (though searching the code doesn't show any usage of it). When resetting the node's cache (twice), the title field contains the correct title and the "title_original" element is gone. The title FIELD array element is always correct.
Edit:
I see now where the problem might be occurring, either it's a title or an entity_translation error. Are you able to move this issue to the Title module or should I open a new one?
Title function title_field_sync_get calls is:
The line
$langcode = field_language($entity_type, $entity, $info['field']['field_name'], $langcode);
returns LANGUAGE_NONE, and$values = $info['callbacks']['sync_get']($entity_type, $entity, $legacy_field, $info, $langcode);
returns an empty title.I guess for entity_translation, the $entity->language should be used instead of field_language?
If I add a watch with $langcode as 'de' it gets the correct title. Hard coding the $langcode and leaving the scheduler module as it was (without patch) worked as it should.
Comment #12
pfrenssenThanks for looking into this. I'll move this to the issue queue of the Title project, maybe the maintainers and users can provide some more insight.
Comment #13
jonathan1055 CreditAttribution: jonathan1055 commentedChanged plain issue url to dynamic link in summary, added related issue, so that the other one knows about this issue, and hid the old patches.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedCould a maintainer please look at my comment (especially #11), maybe the problem's clear to you?
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #16
bnorbi CreditAttribution: bnorbi commented#11 helped me
Comment #17
J-LeeI have wrote a patch regarding to #11.
But definitely need review.
Comment #18
J-LeeI think, this is fixed with alpha8.
The patch (from #17) and #11 produce a wrong behavior (with alpha8).
Could someone confirm this ?
Comment #19
J-LeeI'm closing this, because it works since alpha 8.