Skip to content

[18.0] [FIX] website_altcha: Changes to make sure that altcha defined elements are not being used as global elements - #1232

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
ByteMeAsap:18.0-fix-website_altcha
Oct 23, 2026
Merged

OCA-git-bot merged 1 commit into
OCA:18.0from
ByteMeAsap:18.0-fix-website_altcha

Conversation

@ByteMeAsap

@ByteMeAsap ByteMeAsap commented Oct 15, 2026 •

Copy link
Copy Markdown

This fix avoids defining/overriding the elements(variables/methods) defined in static/lib/altcha.js as global elements so that other functionalities work as expected.

For instance, while I was working on adding the altcha for website_payment module , I had to inherit the _initiatePaymentFlow method. This method in the base make use of Bootstrap Popover as can be seen at https://github.com/odoo/odoo/blob/bcd8e82cf06ae78299144bc1f35b53fab36540b8/addons/website_payment/static/src/js/payment_form.js#L79 . But since the altcha.js also defines Popover at

function Popover($$anchor, $$props) {
, it leads to a TypeError: Popover.getOrCreateInstance is not a function.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @hbrunn,
some modules you are maintaining are being modified, check this out!

@tarteo tarteo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Confirmed, this fixes the issue.

@ByteMeAsap

Copy link
Copy Markdown
Author

@hbrunn , can you please check this?

@hbrunn hbrunn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nagging me not even a week after ocabot already notified me usually has adverse effects up to getting you on my block list.

that being said, thanks for this. though I'm not a fan of modifying bundled files, we can only load js assets as modules from v20 conveniently and implementing this here doesn't seem worth the hassle

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@hbrunn

hbrunn commented Oct 23, 2026

Copy link
Copy Markdown
Member

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-1232-by-hbrunn-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 1a1ab3e into OCA:18.0 Oct 23, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 9e1ecc7. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants