Problem/Motivation
After update to the latest supported version (2.0.9) these errors are shown when update hooks are run:
[error] Found config field fallback in eca_tamper_condition:strtotime with non-supported value.
[error] Found config field fallback in eca_tamper:strtotime with non-supported value.
(I think unrelated, but mixed in was "[error] ECA ran into error from third party in the context of "Collecting all available actions":
> \Drupal\entity\Plugin\Action\DeleteAction has been deprecated in favor of \Drupal\Core\Action\Plugin\Action\DeleteAction. Use that instead.
> Line 7 of /var/www/html/web/modules/contrib/entity/src/Plugin/Action/DeleteAction.php ")
Steps to reproduce
Run eca_update_8011
Proposed resolution
Document, in this issue anyway, what should be fixed.
Would've been nice to have which models had the problem.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork tamper-3560959
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mlncn commentedLogs do not provide more information and neither "strtotime" nor "fallback" appear at all in any ECA configuration so really not sure how this can be fixed by the sitebuilder?
Comment #3
jurgenhaasThe tamper plugins are coming from the tamper module, moving the issue over there.
The reason for the error message is that the strToDate plugin has 2 config properties but the defaultConfiguration() method is missing. Therefore, the fallback for both properties is an empty string, which is not a valid default value for a checkbox. If the default values will be added (similar to e.g. \Drupal\tamper\Plugin\Tamper\TruncateText::defaultConfiguration), then the error messages will be gone.
The other error message is a deprecation message from Drupal core which has to be ignored, we can't do anything about that. EDIT: it's not from core, it comes from the entity module, and there is this issue available with a proposed fix: #3532309: Fix Deprecation notice from DeleteAction class causes errors in ECA module
None of the above error messages should prevent the update hook from doing its work, though.
Comment #4
megachrizHm, for this particular plugin, the defaults should be
NULL. I think that's whydefaultConfiguration()is not defined. The methodgetSetting()would returnNULLif the setting key is not defined.Is a checkbox field not allowed to have
NULLas default? Then it should probably becomeFALSEif$this->getSetting(static::SETTING_FALLBACK)returnsNULL.Current code for the checkbox field:
(note: I see it is calling
t()instead of$this->t().)But I'm willing to define
defaultConfiguration()just with both setting keys set toNULL. Would that help?Comment #5
jurgenhaasI think that
NULLis not a valid default for checkboxes, it should indeed beFALSE. And the default for the date format should be an empty string, I'd say.Those 2 values would also be the settings that you get from
\Drupal\tamper\Plugin\Tamper\StrToTime::submitConfigurationFormwhen the form gets submitted, even if the default values had been NULL.Comment #7
megachrizDo the changes in the MR help to resolve the issue?
Comment #8
jurgenhaasLGTM
Comment #9
darkodev commentedThanks, the MR fixes the "Found config field fallback" messages for me, too.
Comment #10
megachrizMerging the code is scheduled to be merged. Thanks all for testing!