I tried to schedule an action with below configuration:
EVENT:
Entity insert (Reacts after a new entity has been inserted)
Target Entity Type: content
Target Bundle: article
ACTION:
Schedule a task (Schedule a task to the future)
Target Entity Type: content
Target Bundle: article
Field: Created: Authored on [created]
Identifier: Delete article with nid: [node:nid] after 1 Month.
Scheduler:
Time offset: 1
Time Unit: Months
ACTION INSIDE THE SCHEDULE
Delete an entity
Target Entity Type: content
Target Bundle: article
When try to create a new article, the article is not created and the below error is logged:
Drupal\Core\Entity\EntityStorageException: DateTime::__construct(): Failed to parse time string (1552786750) at position 8 (5): Unexpected character in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 783 of S:\Sites\dev.####\web\core\lib\Drupal\Core\Entity\Sql\SqlContentEntityStorage.php).
Thank you,
Comments
Comment #2
c.e.a commentedComment #3
c.e.a commentedComment #4
c.e.a commentedComment #5
Drutech commentedSame error here...
Also the scheduled actions cannot be executed with returned errors
any help yet ?
thanks
Comment #6
yseki commentedIt seems the way I've planned the scheduler to work wasn't matching the requirements you guys have, so I've made some changes on that, the most important one is the now the scheduled task keeps record of the entity that has triggered, allowing the update of the entity.
Example.
Lets say you want to schedule a task to update the publishing status of one node after 6 months of the last changed date.
In order to do that, we can create a Rule that is dispatched and schedule an action to update the node status that has triggered the scheduler in the first place.
It will gonna be on beta-7, hat I'm pushing today.
Comment #8
c.e.a commentedThank you for your time, but still the problem not fixed...
I tried to schedule an action with below configuration:
EVENT:
Entity insert (Reacts after a new entity has been inserted)
Target Entity Type: content
Target Bundle: article
ACTION:
Schedule a task (Schedule a task to the future)
Target Entity Type: content
Target Bundle: article
Field: Created: Authored on [created]
Identifier: Delete article with nid: [node:nid] after 1 Month.
Scheduler:
Time offset: 1
Time Unit: Months
ACTION INSIDE THE SCHEDULE
Delete an entity
Target Entity Type: content
Target Bundle: article
When try to create a new article, the article is not created and the below error is logged:
Drupal\Core\Entity\EntityStorageException: DateTime::__construct(): Failed to parse time string (1552786750) at position 8 (5): Unexpected character in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 783 of S:\Sites\dev.####\web\core\lib\Drupal\Core\Entity\Sql\SqlContentEntityStorage.php).Thank you,
Comment #9
c.e.a commentedComment #10
c.e.a commentedOnly if I check the below checkbox, the 'schedule action' will work without errors.
[X] Save entity as the last action of the task.
Check this option if you are changing values on the entity and you want to persist those changes on the database.
But in my case, there is no need to check this checkbox because...
as per checkbox description, Check this option if you are changing values on the entity but my scheduler is set to DELETE the entity after 'X' months.
Thank you,
Comment #11
c.e.a commentedOk... I believe the issue still exist because I cannot perform database update...
When I visit: /update.php, I see the below:
and when I try to run the update, I receive the below error:
Note: every time I visit:
/update.php... same scenario!Any clue ?!
Thank you
Comment #12
steveoriolI receive a similar error with "drush updb" :
Comment #13
yseki commentedHi guys,
Sorry about that, here is the patch https://www.drupal.org/project/business_rules/issues/3043734#comment-130...
It's updated on dev as well.
Comment #14
c.e.a commented@yuriseki the patch provided here (#3043734: Update to beta7 fails: SQLSTATE[42000] Assigned to: yseki) solved the creation of the schedule but still cannot edit the scheduled action.
Comment #15
c.e.a commented