fix: content-create names the Divi layout when its write fails (S50)
A failing Divi layout write discarded the draft with the fields/terms message (REASON_EXTRAS); it now passes NewDraft::REASON_LAYOUT (ledger T9). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -144,7 +144,7 @@ final class ContentCreateAbility implements Ability
|
||||
try {
|
||||
$layout = $withDivi ? $this->divi?->write($postId, $postType, self::sections($input)) : null;
|
||||
} catch (Throwable $e) {
|
||||
$draft->discard($postId, $e, NewDraft::REASON_EXTRAS);
|
||||
$draft->discard($postId, $e, NewDraft::REASON_LAYOUT);
|
||||
}
|
||||
if ($layout instanceof WP_Error) {
|
||||
return $draft->refuse($postId, $layout);
|
||||
|
||||
@@ -26,6 +26,7 @@ final class NewDraft
|
||||
{
|
||||
public const REASON_INSERT = 'WordPress hat beim Anlegen des Eintrags einen Fehler gemeldet.';
|
||||
public const REASON_EXTRAS = 'Felder, Begriffe oder Beitragsbild konnten nicht gespeichert werden.';
|
||||
public const REASON_LAYOUT = 'Das Divi-Layout konnte nicht gespeichert werden.';
|
||||
|
||||
public function __construct(
|
||||
private PostWriter $writer,
|
||||
|
||||
Reference in New Issue
Block a user