Skip to content

fix content edit job view html (WP-1004)#619

Merged
vsolovei-smartling merged 6 commits into
masterfrom
WP-1004-fix-content-edit-job-postbox-html
May 25, 2026
Merged

fix content edit job view html (WP-1004)#619
vsolovei-smartling merged 6 commits into
masterfrom
WP-1004-fix-content-edit-job-postbox-html

Conversation

@vsolovei-smartling
Copy link
Copy Markdown
Contributor

No description provided.

koloml and others added 4 commits May 20, 2026 12:37
When new React UI was introduced in
ff6b525, element .job-wizard was
covered with the `<div style="display: none">` element, but this element
didn't have the corresponding closing tag.
First condition was forcibly disabled, but the second one was not. This
potentially creates stray closing tags when `$needWrapper` is `true`
Fixed unclosed tag inside ContentEditJob view (WP-1004)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@PavelLoparev PavelLoparev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review findings on the new test file.

{
$source = $this->stripNonHtml(file_get_contents(self::VIEW_FILE));

$source = preg_replace(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pattern 1 is dead on arrival: this PR removes the only $needWrapper && false block from the template, so this preg_replace will never match after merge. Consider removing it to avoid misleading future readers into thinking such a pattern might still exist in the template.

public function testHiddenWrapperHasClosingTag(): void
{
$source = $this->stripNonHtml(file_get_contents(self::VIEW_FILE));
$hiddenOpens = preg_match_all('#<div\s+style\s*=\s*"display:\s*none#i', $source);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test name says "HasClosingTag" but the assertion only checks that at least one <div style="display:none opening tag exists — it never verifies a matching </div> closes it. The test passes trivially even if the closing tag is absent, which is exactly the class of bug this PR fixes.

);
}

private function resolveTemplate(bool $needWrapper): string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolveTemplate() does not strip or simulate the outer if (!$isBulkSubmitPage) conditional, so the #smartling-app div is always included in the count regardless of context. A regression that only manifests on the bulk-submit screen (where that block is suppressed) would not be caught. Consider adding a testHtmlDivTagsBalanceOnBulkSubmitScreen() case that strips the !$isBulkSubmitPage block.

vsolovei-smartling and others added 2 commits May 25, 2026 09:26
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@PavelLoparev PavelLoparev self-requested a review May 25, 2026 07:59
@vsolovei-smartling vsolovei-smartling merged commit c429d53 into master May 25, 2026
3 checks passed
@vsolovei-smartling vsolovei-smartling deleted the WP-1004-fix-content-edit-job-postbox-html branch May 25, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants