Hi,

I've been having an issue where splash pages loaded on pages which are not the front page have their content shown twice. The iframe content of the colorbox appears to be loaded twice at different timestamps. By changing js/splashify_lightbox.js to have colorbox _not_ use the iframe, content is shown only once as expected.

Here's a js backtrace of the two calls that happen when content is duplicated, from js/splashify_init.js

jsmode: lightbox
splashify_init.js:8:7
hostname: example.com
splashify_init.js:9:7
referrer: 
splashify_init.js:10:7
console.trace()
splashify_init.js:11:7
attach
https://example.com/modules/contrib/splashify/js/splashify_init.js:11:7
Drupal.attachBehaviors/<
https://example.com/core/misc/drupal.js:25:11
Drupal.attachBehaviors
https://example.com/core/misc/drupal.js:22:5
<anonymous>
https://example.com/core/misc/drupal.init.js:16:5
t
https://example.com/core/assets/vendor/domready/ready.min.js:4:381


jquery.min.js:4:15845
jsmode: lightbox
splashify_init.js:8:7
hostname: example.com
splashify_init.js:9:7
referrer: 
splashify_init.js:10:7
console.trace()
splashify_init.js:11:7
attach
https://example.com/modules/contrib/splashify/js/splashify_init.js:11:7
Drupal.attachBehaviors/<
https://example.com/core/misc/drupal.js:25:11
Drupal.attachBehaviors
https://example.com/core/misc/drupal.js:22:5
insert/<
https://example.com/core/misc/ajax.js:556:13
each
https://example.com/core/assets/vendor/jquery/jquery.min.js:2:2713
each
https://example.com/core/assets/vendor/jquery/jquery.min.js:2:1001
insert
https://example.com/core/misc/ajax.js:554:9
Drupal.Ajax.prototype.success
https://example.com/themes/contrib/bootstrap/js/misc/ajax.js:155:9
bigPipeProcessPlaceholderReplacement
https://example.com/core/modules/big_pipe/js/big_pipe.js:38:9
each
https://example.com/core/assets/vendor/jquery/jquery.min.js:2:2713
each
https://example.com/core/assets/vendor/jquery/jquery.min.js:2:1001
bigPipeProcessDocument
https://example.com/core/modules/big_pipe/js/big_pipe.js:52:5
bigPipeProcess/timeoutID<
https://example.com/core/modules/big_pipe/js/big_pipe.js:66:12

In this case, I think it can be solved by ensuring that the context when the colorbox is initiated is the main context (window.document).

However, I have also seen it happen through other code paths from contrib modules, eg. facets js/link-widget.js which triggers the Drupal behaviours by calling Drupal.attachBehaviors(context, Drupal.settings);. This I think is maybe more the responsibility of the facets module. I'm not sure if there's a reasonable way of handling this case in splashify.

Comments

kienan created an issue. See original summary.

lysenko’s picture

lysenko’s picture

Assigned: Unassigned » lysenko
Status: Active » Fixed

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

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

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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