Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
public function getDefaultRegion() {
// This cannot be provided by the trait due to
// https://bugs.php.net/bug.php?id=71414 which is fixed in PHP 7.0.6.
return $this->getLayoutDefinition($this->getLayoutId())->getDefaultRegion();
}
With #3053363: Remove support for PHP 5 in Drupal 8.8 we'll no longer be affect by this bug.
Proposed resolution
Move getDefaultRegion to \Drupal\field_layout\Entity\FieldLayoutEntityDisplayTrait
Remaining tasks
User interface changes
None
API changes
New method on trait - this method is currently implemented in both usages in core.
Data model changes
None
Release notes snippet
N/a
Comment | File | Size | Author |
---|---|---|---|
#10 | 3054317-10.patch | 2.31 KB | yogeshmpawar |
#5 | field_layout-8.8-move-to-trait-2.patch | 2.17 KB | iuana |
Comments
Comment #2
iuana CreditAttribution: iuana at Softescu commentedComment #3
iuana CreditAttribution: iuana at Softescu commentedI removed from both classes the method "getDefaultRegion" in favor of FieldLayoutEntityDisplayTrait which will share with both classes the same methods.
Comment #4
iuana CreditAttribution: iuana at Softescu commentedComment #5
iuana CreditAttribution: iuana at Softescu commentedI forgot to remove the comment from the function.
Comment #6
alexpottThe blocker is in!
Comment #7
alexpottLet's fire up the testbot!
Comment #8
BerdirNeeds a reroll because the comments changed.
Comment #9
yogeshmpawarComment #10
yogeshmpawarRe-rolled the patch against 8.8.x branch.
Comment #11
BerdirI think this doesn't need a CR or so, nothing will break even *if* someone used that trait which seems highly unlikely and not currently the case in contrib.
Comment #12
alexpottCommitted 09fb5ce and pushed to 8.8.x. Thanks!