fix: lit-content-create mit divi auf einer Website ohne Divi verlangt keine Fähigkeiten – execute() antwortet mit unsupported (Divi 5 ist nicht aktiv) statt divi_incompatible samt refused-Eintrag
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
39143c01d0
commit
56947e54cf
@@ -112,11 +112,17 @@ final class ContentCreateAbility implements Ability, DeclaresRequirements
|
||||
|
||||
/**
|
||||
* Without divi the call stays in WordPress and needs nothing; with divi it needs what the ContentComposer says it
|
||||
* needs (the Divi integration names its capabilities), so the guard refuses before a draft is inserted.
|
||||
* needs (the Divi integration names its capabilities), so the guard refuses before a draft is inserted. Without an
|
||||
* available composer (Divi 5 not active) nothing is required either: execute() then answers with the precise
|
||||
* unsupported error instead of the guard reporting locked capabilities.
|
||||
*/
|
||||
public function requirements(array $input): array
|
||||
{
|
||||
return array_key_exists('divi', $input) && $this->divi !== null ? $this->divi->requirements() : [];
|
||||
if (! array_key_exists('divi', $input) || $this->divi === null || ! $this->divi->available()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $this->divi->requirements();
|
||||
}
|
||||
|
||||
public function execute(array $input): mixed
|
||||
|
||||
Reference in New Issue
Block a user