Skip to content

[FW][FIX] tools: fix tool method to check empty html content - #53167

Closed
fw-bot wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-saas-13.3-fix-tools-empty-html-dja-SCiE-fw
Closed

[FW][FIX] tools: fix tool method to check empty html content#53167
fw-bot wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-saas-13.3-fix-tools-empty-html-dja-SCiE-fw

Conversation

@fw-bot

@fw-bot fw-bot commented Jun 17, 2020

Copy link
Copy Markdown
Contributor

Description of the issue/feature this PR addresses:
is_html_empty method from 974f512 does not consider self-closing tag.

Current behavior before PR:
If the html content contains self-closing tags (for example <br/>), the above method returns False even if the content is void.

Desired behavior after PR is merged:
Regular Expression from method is_html_empty also considers self-closing tags while checking for void content.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #53157

Since a recent commit[1], we have a utility method in tools named
'is_html_empty'  that checks whether the given html content is
void(containing only formatting tags) or not. However, the re from
this method does not consider the case of self closing tags, fox ex
`<br/>`. In such cases, the method returns Falsy value even if the
content is void.

This commit fixes the issue by considering self-closing void tags
in the regular expression.

commit[1] - odoo@974f512

Task - 2267689

X-original-commit: 0fd6c93
@fw-bot
fw-bot requested a review from a team as a code owner June 17, 2020 14:19
@robodoo robodoo added the forwardport This PR was created by @fw-bot label Jun 17, 2020
@fw-bot

fw-bot commented Jun 17, 2020

Copy link
Copy Markdown
Contributor Author

Ping @dja-odoo, @tde-banana-odoo
This PR targets master and is the last of the forward-port chain containing:

To merge the full chain, say

@fw-bot r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@tde-banana-odoo

Copy link
Copy Markdown
Contributor

@fw-bot r+

@robodoo robodoo added r+ 👌 CI 🤖 Robodoo has seen passing statuses labels Jun 17, 2020
robodoo pushed a commit that referenced this pull request Jun 17, 2020
Since a recent commit[1], we have a utility method in tools named
'is_html_empty'  that checks whether the given html content is
void(containing only formatting tags) or not. However, the re from
this method does not consider the case of self closing tags, fox ex
`<br/>`. In such cases, the method returns Falsy value even if the
content is void.

This commit fixes the issue by considering self-closing void tags
in the regular expression.

commit[1] - 974f512

Task - 2267689

closes #53167

X-original-commit: 0fd6c93
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
@C3POdoo C3POdoo added the RD research & development, internal work label Jun 17, 2020
@robodoo robodoo closed this Jun 17, 2020
@robodoo
robodoo temporarily deployed to merge June 17, 2020 16:18 Inactive
@dharmrajsinh-jhala
dharmrajsinh-jhala deleted the master-saas-13.3-fix-tools-empty-html-dja-SCiE-fw branch June 18, 2020 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI 🤖 Robodoo has seen passing statuses forwardport This PR was created by @fw-bot RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants