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,
Is it possible to access message returned by:
while (FEEDS_BATCH_COMPLETE != feeds_source('my_feed', 0)->import());
So I could use returned string i.e. "There are no nodes." or how many nodes were imported/updated?
Currently I'm using drush eval and cron for feed imports, and I would like to uset those values in bash script, but thats not the case if I get it as php variable its fine for me.
Thanks in advance,
Comments
Comment #1
rolkos CreditAttribution: rolkos commentedI've found solution for this issue:
drupal_get_messages()
But it's not perffect. I suspect that if between import and drupal_get_messages() some script will set new message I will get that new message instead of feeds message.
Comment #2
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedIf you have access to the FeedsSource object, you can get the statical information by calling the
state()
method on the FeedsSource object:This FeedsState object contains (among more) the following information:
Example: