Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link is not saved in NEO field when we use it in child blocks #90

Closed
nielcapp1 opened this issue Sep 21, 2023 · 10 comments
Closed

Link is not saved in NEO field when we use it in child blocks #90

nielcapp1 opened this issue Sep 21, 2023 · 10 comments

Comments

@nielcapp1
Copy link

Describe the bug

When I try to save a link in a neo-field where the block with the hyper field is assigned as a child block to a neo block, my link is not saved.

This bug also occurs if we specify the setting in the neo block with the hyperfield that the relevant block at the top should not be used.

Steps to reproduce

  1. Create a Craft CMS project with Neo (3.9.0) and Hyper (1.1.12)
  2. Create a Neo field
  3. Create the Longform block with the child blocks:

Scherm­afbeelding 2023-09-21 om 11 06 25

  1. The settings of the Longform block in Neo:

Scherm­afbeelding 2023-09-21 om 11 07 03

  1. The settings of the Actions block in longform:

Scherm­afbeelding 2023-09-21 om 11 07 03

  1. The field layout of the Actions block:

Scherm­afbeelding 2023-09-21 om 11 11 12

  1. The settings of the Actions field:

Scherm­afbeelding 2023-09-21 om 11 11 53

  1. Add the Neo field to a single and try to save some content as described in the bug.

Craft CMS version

4.5.5

Plugin version

1.1.12

Multi-site?

No

Additional context

The version of Neo was 3.9.0. After downgrading NEO to 3.8.6 I no longer have this problem.

@engram-design
Copy link
Member

engram-design commented Sep 21, 2023

Seems to be working for me, although can you confirm your 5. The settings of the Actions block in longform: setting, which is repeated from the Longform block settings?

@nielcapp1
Copy link
Author

Yes, in the Longform block we can repeat the Title, Text and Actions blocks.

@engram-design
Copy link
Member

What I mean is - they’re the exact same image. Is this correct? I’m pretty sure I understand your setup but I wanted to double check as I can’t replicate this behavior.

when you mention is doesn’t save, do any values stay? Do you see the auto save spinner near the entry title as you edit the Neo and Hyper field?

@stevendierick
Copy link

stevendierick commented Sep 23, 2023

I'm having the same issues. But I'm starting to suspect this is a Neo thing... Doesn't seem to work for other fields either, such as plain text and asset fields. Vizy also seems to fail to initialize within Neo.

1. Hyper in Neo tests

2. Plain text, asset, Vizy, and Hyper in Neo tests

Running all the latest versions:

  • Craft CMS version: 4.5.5
  • Hyper version: 1.1.12
  • Vizy version: 2.1.9
  • Neo version: 3.9.1

I'll open an issue at Neo later today and reference this issue.

Edit: Opened an issue at Neo - spicywebau/craft-neo#787

@ttempleton
Copy link

Confirming this was a Neo bug related to changes in 3.9, fixed now in 3.9.2.

@stevendierick
Copy link

Hyper still seems to have some issues with the new Neo updates.

When you add a block with a Hyper field, the field isn't fully initialised the first time. Refreshing or saving fixes this BUT it will break nested Hyper fields (via slideout).

Nested Hyper fields (via slideout) only work if you save again after the initial save (to fix the initialization), and only after each save when adding a new parent link. If you add a new parent link without saving first then adding nested Hyper links will also fail.

Also, when adding nested Hyper links (via slideout) and re-opening it without saving the entry, it won't show your nested Hyper links anymore. BUT if you cancel the slideout and then save the entry, the nested Hyper links will have been added. BUT if you would have saved the slideout, with the empty nester Hyper links, and continue to save your page then the nested Hyper links will have been removed (or still empty).

I've also tested nested Hyper fields directly in the parent field (not via slideout) and that seems to work fine. I remember that nested Hyper links via slideout has different behaviour from my original nesting issue. Might be related since the new Neo changes?

I've recorded a couple of tests:

Versions:

  • Craft CMS: 4.5.5
  • Hyper: 1.1.12
  • Neo: 3.9.2

@engram-design
Copy link
Member

I'm not sure of the details of what's happened with Neo, but it now no longer loads the hyper.js file, despite loading the inline new Craft.Hyper.Input() call - we need both.

It could be down to how we register the JS script with Vite, but it's an asset bundle, so that should be pretty standard.

ttempleton added a commit to spicywebau/craft-neo that referenced this issue Sep 27, 2023
@ttempleton
Copy link

The change in Neo causing that is the same as described in verbb/vizy#260 (comment). In this case it means that the registered hyper.js file isn't being picked up. I'm honestly not sure how that would need to be fixed (e.g. adding the Craft view's startJsFileBuffer() / clearJsFileBuffer() methods to Neo isn't picking up anything). But in the meantime, I've just released Neo 3.9.3 with the enableLazyLoadingNewBlocks plugin setting, which can be disabled in the config/neo.php file to restore pre-3.9.0 behaviour and work around this issue.

@engram-design
Copy link
Member

@ttempleton Thanks for that. Yep, I went for a deep-dive into what's going on as startJsFileBuffer() doesn't do anything. Initially I thought this change might be the culprit, but reverting that had no effect. Looking into it.

@ttempleton
Copy link

This is fixed in Neo 3.9.4, read from here on for details: spicywebau/craft-neo#790 (comment)

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

No branches or pull requests

4 participants