Editing Action generates two errors

Created on 21 June 2017, over 7 years ago
Updated 28 May 2024, 6 months ago

Hi,

When I'm going to "admin/config/system/actions/configure/***" for existing action generated by Domain Access I have two errors :

Notice: Undefined index: id in Drupal\domain_access\Plugin\Action\DomainAccessActionBase->buildConfigurationForm() (line 65 of modules/contrib/domain/domain_access/src/Plugin/Action/DomainAccessActionBase.php).

Warning: Invalid argument supplied for foreach() in Drupal\Core\Render\Element\Checkboxes::valueCallback() (line 100 of core/lib/Drupal/Core/Render/Element/Checkboxes.php).

After analyzing the code, I noticed that on the buildConfigurationForm() function in the file "Drupal\domain_access\Plugin\Action\DomainAccessActionBase" there is two strange things.

First one : My object $this->configuration return a key "domain_id" and not "id" as mentionner on line 65
Second one : the #default_value expects an array and we have a string.

Are you reproducing the same behaviour ?

Thanks

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France guilhom Toulouse

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Sorry for being new here. Patch #15 works for us with the minor caveat that for Drupal 10.2.4 with PHP 8.1.27 I get the following two variables need to be typed, likely due to when this patch was originally made.

    public string $value_value;
    public ?array $valueOptions;
    

    After applying the patch I can use actions and bulk assign domains via /admin/content

  • Status changed to Postponed: needs info 6 months ago
  • πŸ‡«πŸ‡·France dqd London | N.Y.C | Paris | Hamburg | Berlin

    Is this issue still relevant in 2.0 branch? It is recommended to use latest beta 2.0 release and new patches against latest 2.0-dev since branch 8.x is not supported no more.

  • πŸ‡ΊπŸ‡ΈUnited States eswiderski

    @dqd yes, it still applies to 2.0-dev

  • Status changed to Needs work 6 months ago
  • πŸ‡«πŸ‡·France dqd London | N.Y.C | Paris | Hamburg | Berlin

    Thanks @eswiderski good to now.

    #22 @cpocket: Thanks for the review.

    I get the following two variables need to be typed, likely due to when this patch was originally made.

    public string $value_value;
    public ?array $valueOptions;

    I think this is related to: πŸ› DomainAccessCurrentAllFilter missing variable type inheritance Needs work and would be fixed there. I would encourage to commit the other first and then try to reroll this one here to be committed afterwards.

Production build 0.71.5 2024