Skip to content

Conversation

@CySSoO
Copy link
Contributor

@CySSoO CySSoO commented Sep 12, 2025

Summary

  • Load video products on demand via new videoproducts front controller
  • Fetch products with jQuery and build modal dynamically for better performance

Testing

  • php -l controllers/front/videoproducts.php
  • php -l config/allowed_files.php
  • node --check views/js/everblock.js

https://chatgpt.com/codex/tasks/task_e_68c3c53501b88322abfae16bdc58bf62

@CySSoO CySSoO merged commit aff00e5 into master Sep 12, 2025
0 of 6 checks passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +292 to +296
},
success: function (html) {
let modalId = 'productVideoModal-' + blockId;
let modal = $('<div>', {
'class': 'modal fade everblock-video-product-modal',

Choose a reason for hiding this comment

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

[P1] Fail gracefully when no products can be loaded

The click handler now creates the modal only inside the AJAX success callback. When the request fails (invalid token, network error) or when a block is configured without product_ids—which was previously allowed—the controller returns 4xx and the success handler never runs, so no modal is instantiated and the video cannot be played at all. Before this change, videos opened regardless and the products list was simply empty. Consider creating the modal before the request and populating it conditionally so that videos still open even when product data is unavailable.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants