Editing Action generates two errors

Created on 21 June 2017, over 7 years ago
Updated 29 April 2024, 8 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 review

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France guilhom Toulouse

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

Merge Requests

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 7 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 7 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.

  • πŸ‡΅πŸ‡ΉPortugal dubois

    Here's a naive re-roll of #15 against 2.0.x. Needed it urgently to keep an ECA rule working.

  • First commit to issue fork.
  • Pipeline finished with Success
    6 days ago
    Total: 216s
    #369831
  • Pipeline finished with Success
    6 days ago
    Total: 198s
    #369851
  • Pipeline finished with Success
    6 days ago
    Total: 211s
    #369868
  • πŸ‡·πŸ‡΄Romania vasike Ramnicu Valcea

    This is still a valid issue
    So I created a MR using the latest (re-rolled) patch (#26) and then solve some PHPCS and PHPStan small issues to make it green.

    This also solve a (smaller) related issue : https://www.drupal.org/project/domain/issues/3478258 πŸ’¬ Undefined array key "id" Domain Access Active

    For me, the latest patch, is more like RTBC as it works for me and probably also @dubois ...

    But let's review and test once again.

    p.s. Probably we need also let people know they need to re-export the updated configs.

Production build 0.71.5 2024