Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] base: prevent rtlcss compilation errors #179852

Closed

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Sep 11, 2024

Steps to reproduce:

  • Include in your assets a CSS file with invalid formatting.
  • Translate your website in RTL language.

The website will never load and you will be left with a blank page.

Cause of the issue:
rtlcss never exit with a returncode, consequently our error management there is useless. As from rtlcss 4.1.0 1, an error code is returned but only when using a CSS file. In our case, Odoo pass the CSS payload via the stdin. A PR 2 has been opened on rtlcss to also exit with a return code in this scenario (and log details to stderr). In the meantime and also for earlier versions, the error management had to be slightly adjusted. As we cannot deduce any informations from the return code (and the stderr is completely empty), we can exploit the fact that, in case of errors, rtlcss doesn't output anything to stdout.


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

Forward-Port-Of: #179784
Forward-Port-Of: #178021

@robodoo
Copy link
Contributor

robodoo commented Sep 11, 2024

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Sep 11, 2024

This PR targets 17.0 and is part of the forward-port chain. Further PRs will be created up to master.

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

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Sep 11, 2024
@fw-bot
Copy link
Contributor Author

fw-bot commented Sep 11, 2024

@lade-odoo @aab-odoo ci/runbot failed on this forward-port PR

@C3POdoo C3POdoo added the RD research & development, internal work label Sep 11, 2024
Steps to reproduce:

- Include in your assets a CSS file with invalid formatting.
- Translate your website in RTL language.
> The website will never load and you will be left with a blank page.

Cause of the issue:
`rtlcss` never exit with a returncode, consequently our error management
there is useless. As from `rtlcss` 4.1.0 [1], an error code is returned but
only when using a CSS file. In our case, Odoo pass the CSS payload via
the `stdin`. A PR [2] has been opened on `rtlcss` to also exit with a return
code in this scenario (and log details to `stderr`).
In the meantime and also for earlier versions, the error management had
to be slightly adjusted. As we cannot deduce any informations from the
return code (and the `stderr` is completely empty), we can exploit the
fact that, in case of errors, `rtlcss` doesn't output anything to `stdout`.

[1]: MohammadYounes/rtlcss@4e62545
[2]: MohammadYounes/rtlcss#342

X-original-commit: a50f197
@lade-odoo lade-odoo force-pushed the 17.0-15.0-rtlcss_errors-lade-2M-O-fw branch from 066487e to 402eba5 Compare September 12, 2024 12:11
@fw-bot
Copy link
Contributor Author

fw-bot commented Sep 12, 2024

@lade-odoo @aab-odoo this PR was modified / updated and has become a normal PR. It must be merged directly.

@C3POdoo C3POdoo requested review from a team, kmagusiak, HydrionBurst, aab-odoo and BastienFafchamps and removed request for a team September 12, 2024 12:13
@lade-odoo
Copy link
Contributor

@robodoo r+

@robodoo robodoo closed this in 52ebdb5 Sep 12, 2024
@fw-bot fw-bot deleted the 17.0-15.0-rtlcss_errors-lade-2M-O-fw branch September 26, 2024 16:09
riccardo-metrum pushed a commit to resultrum/odoo that referenced this pull request Sep 30, 2024
Steps to reproduce:

- Include in your assets a CSS file with invalid formatting.
- Translate your website in RTL language.
> The website will never load and you will be left with a blank page.

Cause of the issue:
`rtlcss` never exit with a returncode, consequently our error management
there is useless. As from `rtlcss` 4.1.0 [1], an error code is returned but
only when using a CSS file. In our case, Odoo pass the CSS payload via
the `stdin`. A PR [2] has been opened on `rtlcss` to also exit with a return
code in this scenario (and log details to `stderr`).
In the meantime and also for earlier versions, the error management had
to be slightly adjusted. As we cannot deduce any informations from the
return code (and the `stderr` is completely empty), we can exploit the
fact that, in case of errors, `rtlcss` doesn't output anything to `stdout`.

[1]: MohammadYounes/rtlcss@4e62545
[2]: MohammadYounes/rtlcss#342

closes odoo#179852

X-original-commit: a50f197
Signed-off-by: Aaron Bohy (aab) <[email protected]>
Signed-off-by: Laurent Desausoi (lade) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants