hyper icon indicating copy to clipboard operation
hyper copied to clipboard

"Showing your unsaved changes." keeps popping with hyper fields

Open samuel-clara opened this issue 7 months ago • 7 comments

Describe the bug

When opening an entry with a Hyper field "Showing your unsaved changes." keeps popping up after not making any changes. When discarding changes and changing tab this reappears.

By disabling Hyper plugin this doesn't happen anymore. Same on all entries with no hyper fields.

Steps to reproduce

  1. going to an entry an entry with a hyper field, changing tab and Showing your unsaved changes. appears Image
  2. Discard changes, change tab. Message reappears

Craft CMS version

5.7.1

Plugin version

2.2.4

Multi-site?

Yes

Additional context

No response

samuel-clara avatar Apr 17 '25 15:04 samuel-clara

Can you comment on what your Hyper field looks like - as in your link type field layout - what attributes and custom fields do you have added? I have seen this happen with element-based links, but we should be taking care of that.

engram-design avatar Apr 22 '25 11:04 engram-design

My hyper fields have following link types:

  1. Site
  2. Asset
  3. URL
  4. Email

I have no custom fields, just the default ones in the content tab: linkValue and linkText (this is selected as mandatory. Default link Type is Site, Enable New Windows is enabled, the other two options are disabled, Translation Method is "translate for each language".

samuel-clara avatar Apr 22 '25 11:04 samuel-clara

Thanks for clarifying, that all seems pretty basic. Do you see the same behaviour if you pick a certain link type, or it happens no matter the link type you pick?

engram-design avatar Apr 24 '25 01:04 engram-design

We’re seeing the same issue on one of our sites after the latest updates to CraftCMS and Hyper in the development environment. Previously, we were running CraftCMS 5.6.5.1 and Hyper 2.2.3 without any issues.

In our case, the Hyper field is nested within a Neo field (also updated from 5.2.23 to 5.4.2).

If I recall correctly, we encountered the same issue a while back when using older versions of CraftCMS and Hyper. The issue then disappeared but has now resurfaced.

Let me know if I can provide any additional information.

superflausch avatar Apr 24 '25 07:04 superflausch

Righto, I'll test with Neo - it's not triggering this behavior for me in top-level Hyper fields, and I've tested those link types.

engram-design avatar Apr 24 '25 10:04 engram-design

I'm also seeing this issue, and not using Neo.

It seems to happen whenever you interact with the page, before that it is fine.

Craft CMS: 5.7.4 Hyper: 2.2.4

Just a Hyper field with either a single or multiple link option:

https://github.com/user-attachments/assets/189e8cf5-8fde-4724-ba78-4a8ec33b1c2a

bymayo avatar Apr 29 '25 13:04 bymayo

Looks like the latest update of Hyper (2.2.5) fixes this. At least for us the update resolved the issue. 👍

superflausch avatar May 07 '25 09:05 superflausch

I'm still seeing this problem with the the latest version of Hyper (2.2.6) and Craft 5 under these conditions:

  • The Hyper field is in an entry type assigned to a Matrix field.
  • The Matrix field is on the second tab when editing an entry (or any tab other then the default tab when editing an entry).
  • The entry type block in the Matrix field containing the Hyper field is NOT collapsed (when the block is initially collapsed and subsequently opened, the problem does not occur)
  • Clicking on the second tab causes the 'unsaved changes' message to appear.

croxton avatar Jun 02 '25 10:06 croxton

@croxton Looking into this, but not immediately able to reproduce:

  • What's the layout of the Matrix field (cards, inline-blocks, etc)?
  • What link type is the Hyper field using (Entries, URL, etc)?
  • Is the Hyper field setup for single or multiple links?

And a quick video - https://share.cleanshot.com/Jn7qt7lJ

engram-design avatar Jun 02 '25 23:06 engram-design

@engram-design

  • Matrix is set to inline blocks
  • Enabled link types are Asset, Category, Email, Entry and URL (default Entry)
  • The Hyper field is limited to one link

One further detail that I should have added: the Hyper field is inside another Matrix field, which is also set to inline blocks. So this is a Hyper field inside a Matrix inside a Matrix.

Image

croxton avatar Jun 03 '25 13:06 croxton

Thanks for confirming that. So I see it's happening even for a URL based link as well. There were some complications with element-based links which is why I asked about it.

I've also testing nested Matrix fields, but no different on my end. I'll continue playing with this and maybe even replicate your other field types in those Matrix fields just in case. If you're up for isolating things by removing all other fields so it's just Matrix > Matrix > Hyper, that'll be handy too.

engram-design avatar Jun 04 '25 00:06 engram-design

Aha, it's due to the Custom Attributes being on the first tab for Hyper fields. That's just down to how serialization of the editable table component happens.

Fixed for the next release. To get this early, run composer require verbb/hyper:"dev-craft-5 as 2.2.6".

engram-design avatar Jun 04 '25 00:06 engram-design

Amazing thank you!

croxton avatar Jun 04 '25 15:06 croxton

Updated in 2.2.7.

engram-design avatar Jul 18 '25 14:07 engram-design