Installation on already existing sites broken with no real preview shown

Created on 15 March 2023, almost 2 years ago
Updated 21 March 2023, over 1 year ago

Problem/Motivation

I've brought the issue up on Slack today, I'll just open an issue alongside that the issue isn't getting lost. Yesterday night when I first learned about same page preview. i've installed the module (the dev version) on already existing local project ran with ddev (both on 10.1.x-dev and php 8.2.0 , one with the standard install profile the other with demo_umami). in both cases each site has several other module installed. after installing same page preview i get the following (see the videos). it happens in safari as well as latest edge for example. and there arent any errors in the devtools. and today i had installed a fresh clean install with 10.1.x-dev and the standard profile and there everything works. no idea what it is causing it but if anyone could provide and suggestion how i could debug and track the root cause down i'll try my luck. (am not developer)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

User interface

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rkoller
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States brianperry

    @rkoller Hate to be the person who says 'clear cache,' but did you clear the cache after enabling the module? It almost seems like some of the js needed to support this functionality isn't being loaded. Still doesn't make sense to me why this would be happening though - I'd expect the off canvas dialog to function and then functionality to be broken within the dialog if our scripts weren't available.

    If we can pinpoint this, wondering if we'll need to do something during install to prevent it.

  • @brianperry opened merge request.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States brianperry

    My previous 'clear cache' related comment actually seems more similar to https://www.drupal.org/project/same_page_preview/issues/3348241#comment-... ๐Ÿ› The preview is showing redundant controls which should be shown in a new window instead Closed: works as designed

    I've actually been able to duplicate something that feels similar to this. If I configure Drupal to not aggregate my css and js files I can see this if I reload the page and click the 'toggle preview' button quickly. If I instead give the page a little more time to load, the dialog will open as expected when I click on the toggle button. If I configure css and js to be aggregated I can't duplicate this. So that tells me that we're not doing enough to ensure our dependencies are loaded before the toggle button is interactive.

    Layout builder is the area in core that I'm most familiar with that uses the off canvas dialog. They add `core/drupal.dialog.off_canvas` as an explicit dependency of their library. Adding the same dependency to our same_page_preview library seems to resolve the issue for me.

    I opened an MR with this change. I'm not positive that this will resolve @rkoller's issue as what is shown in the videos feels a little different, but even if it doesn't, this seems like a worthwhile change.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States cosmicdreams Minneapolis/St. Paul

    As a follow up, don't know if this is an over-optimization, perhaps we can drop the explicit core/drupal & core/jquery dependencies. core/drupal.dialog.off_canvas already brings those dependencies in.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States cosmicdreams Minneapolis/St. Paul

    @rkoller can you retest?

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    @brianperry if i remember correctly i cleared the cache after the install. but i've directly updated the dev version for the umami install, cleared cache and launched and the inception is gone. done the same steps for the standard install. before the update i retested, again cleared the cache, the inception persisted, updated the dev version via composer, cleared the cache again reloaded the node edit form, pressed the toggle preview button, and the inception is also gone for the other install i ran into (and those were the only two installs i ran into that inception thing). so the inception thing this issue was about seems fixed (eventhough you were uncertain if your changes would solve it :D thanks!)

    the only detail that persists is ๐Ÿ› The preview is showing redundant controls which should be shown in a new window instead Closed: works as designed also both installs show the redundant controls after the update now.

  • Status changed to Fixed over 1 year ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    i'll mark the issue as fixed upon the recommendation by @cosmicdreams on slack. as noted in #8 the changes fixed the inception style for both sites i was running into the issue.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States brianperry

    As a follow up, don't know if this is an over-optimization, perhaps we can drop the explicit core/drupal & core/jquery dependencies. core/drupal.dialog.off_canvas already brings those dependencies in.

    I think we can remove core/drupal, but given the state of jQuery and Drupal I think it would be safest to keep that one. Very unlikely, but possible that off canvas could remove the jQuery dependency before we do. Keeping that dependency would protect us from that.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States brianperry

    Excited that this fixed the original issue reported here.

    Also created https://www.drupal.org/project/same_page_preview/issues/3348950 ๐Ÿ“Œ Remove Explicit core/drupal Dependency from same_page_preview library Fixed to track the comment in #6

  • Status changed to Fixed over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States cosmicdreams Minneapolis/St. Paul
Production build 0.71.5 2024