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

[Bug]: The selection is empty if prototype framework is used #727

Closed
claudiuj opened this issue Sep 1, 2024 · 2 comments
Closed

[Bug]: The selection is empty if prototype framework is used #727

claudiuj opened this issue Sep 1, 2024 · 2 comments
Labels
wontfix This will not be worked on

Comments

@claudiuj
Copy link

claudiuj commented Sep 1, 2024

Expected Behavior

I know that Prototype is an old framework but it is still used by Magento 1.9.

Current Behavior

When I use cookieconsent with Prototype (the latest version), the selection saved in the cookie is empty (the categories array is empty)

Steps to reproduce

  1. Create a config file using GUI interface
  2. Create a simple HTML file that includes Prototype framework (I've attached a screenshot of the source
Screenshot 2024-09-01 at 22 15 42 )
  1. Run HTML file in browser
  2. Set cookie preference
  3. Check the cookie value (categories array)

Proposed fix or additional info.

No response

Version

3.0.1

On which browser do you see the issue?

No response

@claudiuj claudiuj added the bug Something isn't working label Sep 1, 2024
@github-actions github-actions bot added the triage yet to be reviewed label Sep 1, 2024
@orestbida orestbida added good first issue Good for newcomers and removed bug Something isn't working triage yet to be reviewed labels Sep 4, 2024
@orestbida
Copy link
Owner

@claudiuj, this is due to prototype modifying the standard Array.from function, see prototypejs/prototype#338.

You can restore the default Array.from as suggested in prototypejs/prototype#362:

<script>
  const iframe = document.body.appendChild(
    document.createElement('iframe')
  );
  const iframeArray = iframe.contentWindow.Array;
  document.body.removeChild(iframe);
  Array.from = iframeArray.from;
</script>

<script type="module" src="cookieconsent-config.js"></script>

This might break other things in your page though.

@orestbida orestbida added wontfix This will not be worked on and removed good first issue Good for newcomers labels Sep 4, 2024
@claudiuj
Copy link
Author

claudiuj commented Sep 4, 2024

it is working;

Thank you.

@orestbida orestbida closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants