Problem/Motivation

When we use Colorbox Modal and Video (lazy load) formatters the rendered field content moves to the video-embed-field-modal. But when JS adds it to the page, it does not restart Drupal Behaviors for the added content.
This can potentially break the Drupal Behaviors of the other modules. For example Cookie Content Blocker or the custom one.

Steps to reproduce

1. Configure the video embed field with a simple Video formatter
2. To avoid looking for a module that can make JS changes to the field, create a test library that makes some minimal changes to the field content. For example, adds a class.
3. Check if your test code is working
4. Change the Video formatter to Colorbox Modal or Video (lazy load) formatter.
5. Check if your test code is still working

Proposed resolution

Reattach Drupal Behaviors after adding content to the page.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

HitchShock created an issue. See original summary.

hitchshock’s picture

Status: Active » Needs review
StatusFileSize
new1.09 KB
hitchshock’s picture

Issue summary: View changes
hitchshock’s picture

StatusFileSize
new1.1 KB

reszli made their first commit to this issue’s fork.

reszli’s picture

created an MR with the changes, also getting rid of the jquery/once in favour of core/once

jorgik made their first commit to this issue’s fork.

joum’s picture

Status: Needs review » Needs work

Latest MR21 patch does not apply on 3.0.0-beta2

mably made their first commit to this issue’s fork.

mably’s picture

Status: Needs work » Needs review

@joum MR 21 is targeting the 8.x-2.x branch, use MR 85 for the 3.x version.

mably’s picture

Version: 8.x-2.x-dev » 3.x-dev
mably’s picture

Could we have some RTBC please?

  • mably committed fb252c5d on 3.x authored by jorgik
    Issue #3313587 by hitchshock, reszli, jorgik, mably: Missing Drupal...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.