Skip to content

Conversation

Copy link

Copilot AI commented Jun 17, 2025

Problem

Users reported encountering Uncaught TypeError: this.legacyPrivacyCheck is not a function when trying to play videos with the bundle in Contao 5.3.27. This prevented videos from loading and privacy dialogs from appearing.

Root Cause

The issue occurred because:

  1. The legacyPrivacyCheck() method was intentionally removed from the source code in the feature/contao_5 branch as part of legacy cleanup
  2. However, the compiled JavaScript assets still contained calls to this.legacyPrivacyCheck() from previous builds
  3. This created a runtime error when the Video class constructor tried to call a non-existent method

Solution

Applied minimal surgical fixes to remove the orphaned method calls from compiled assets:

  • public/assets/contao-video-bundle.js: Removed this.legacyPrivacyCheck(), call
  • src/Resources/public/assets/contao-video-bundle.js: Removed this.legacyPrivacyCheck(), call

Verification

✅ No this.legacyPrivacyCheck() calls remain in any compiled assets
✅ JavaScript syntax validation passed
✅ Minimal change scope (only 1-line changes to 2 asset files)
✅ Compatible with both master and feature/contao_5 branch structures

Impact

  • Videos can now be played without JavaScript errors
  • Privacy dialogs work correctly
  • Backward compatibility preserved where legacy support still exists in source
  • No breaking changes to the public API

The fix ensures the video bundle works correctly in Contao 5.3.27 environments.

Fixes #25.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI added 2 commits June 17, 2025 08:27
- Removed orphaned call to this.legacyPrivacyCheck() from compiled JavaScript
- The method was already removed from source code but compiled assets were outdated
- This fixes the 'TypeError: this.legacyPrivacyCheck is not a function' error
- Minimal surgical fix that only removes the problematic method call
- Also fixed the compiled assets in src/Resources/public/assets/
- Ensures compatibility across both branch structures
- The method definition remains where it exists in source, only the problematic call is removed
Copilot AI changed the title [WIP] Uncaught TypeError: this.legacyPrivacyCheck is not a function Fix: Remove orphaned legacyPrivacyCheck call causing TypeError in Contao 5 Jun 17, 2025
Copilot AI requested a review from heimrich-hannot June 17, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uncaught TypeError: this.legacyPrivacyCheck is not a function

2 participants