Problem/Motivation
The function getSchema in the class Drupal\patternkit\Entity\Pattern is checking if the schema is value with isset($schema). But schema is always defined and never null it's a Drupal\Core\Field\FieldItemList.
$schema = $this->get('schema');
if (!isset($schema)) {
$this->fetchAssets();
}
Proposed resolution
$item = $this->get('schema')->first();
if (empty($item)) {
$this->fetchAssets();
$item = $this->get('schema')->first();
}
Issue fork patternkit-3345356
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 #3
sluceroGood catch! This looks like a lot cleaner solution for fetching those values. For consistency I'd like to apply that same pattern to the other getter methods in that class as well, and then this should be good to go!
Comment #4
sluceroComment #6
sluceroMerging for inclusion in the Beta 7 release via #3327256: Beta 7 Release Plan.
Thanks for the work here!