Problem/Motivation

Themes can alter forms (https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/lib/Drupal/C...), but they can't alter inline entity forms using.

Proposed resolution

Make it so that themes can also use hook_inline_entity_form_entity_form_alter() and hook_inline_entity_form_reference_form_alter().

Command icon 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

rp7 created an issue. See original summary.

rp7’s picture

Status: Active » Needs review

podarok made their first commit to this issue’s fork.

podarok’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Status: Needs review » Fixed

tnx

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

geek-merlin’s picture

Version: 2.0.x-dev » 3.x-dev
Status: Closed (fixed) » Needs review
Related issues: +#3401656: Clean up problematic 2.x branch

Bulk reopen.

geek-merlin’s picture

Status: Needs review » Reviewed & tested by the community

Review:
- Regression risk? Very low, so can be committed without tests.
- Why do some hooks also dispatch to themes, why others not?
- hook_views_ui_display_tab_alterhas a good explanation:

    // In AJAX context, ViewUI::rebuildCurrentTab() returns this outside of form
    // context, so hook_form_view_edit_form_alter() is insufficient.
    // @todo remove this after
    //   https://www.drupal.org/project/drupal/issues/3087455 has been resolved.
    $this->moduleHandler->alter('views_ui_display_tab', $build, $view, $display_id);
    // Because themes can implement hook_form_FORM_ID_alter() and because this
    // is a workaround for hook_form_view_edit_form_alter() being insufficient,
    // also invoke this on themes.
    // @todo remove this after
    //   https://www.drupal.org/project/drupal/issues/3087455 has been resolved.
    $this->themeManager->alter('views_ui_display_tab', $build, $view, $display_id);

- Does this need an update in ief.api-php?
- Yes, will do that on commit.

geek-merlin’s picture

Also added a Change record for the new constructor argument, just to be sure:
https://www.drupal.org/node/3413055

  • geek-merlin committed f8d53391 on 3.x
    Issue #3224955 by rp7, geek-merlin: Allow themes to alter inline entity...
geek-merlin’s picture

Status: Reviewed & tested by the community » Fixed

Done.

dww’s picture

So you're still adding new features to the 3.x branch, and therefore the 3.0.x series? I thought part of the problem with the 2.0.x branch is that it was ignoring semver. 3.0.x should really be only bug fixes and tasks at this point. We probably need a 3.0.x branch now, so we can backport stable-only changes there, and leave 3.x as "main", for new features towards the 3.1.x series.

geek-merlin’s picture

@dww: The problem with 2.x was missing QA making thousands to test rabbits. Not semver.

Having said that, i'm split what the best semver policy is for the future. For now imho it's RC still.
But as i said in the stable release issue, RC18 may be the last.

Opened #3413068: Maintenance policy.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.