Comments (10)
Stupid question but are you running at least version 1.3.1 or greater? I actually fixed this issue in 1.3.1 and can't seem to reproduce this in later versions. Otherwise, can you tell me what the specs are of your environment? (Browser as well as Craft & PHP version) Thanks
from craft-neo.
No prob! I'm running Neo 1.3.3. Running Craft CMS 2.6.2903, PHP 5.6.10.
Chrome Version 52.0.2743.116 (64-bit)
Safari Version 9.1.2 (11601.7.7)
I'm on my local box using Mamp. So I did a quick switch to PHP 7.0.8 and I still see the issue.
However, I'm not seeing the issue in Firefox 45.0.1 or 48.0. So this is most likely a webkit thing... I'll see if I can debug a bit more on this.
from craft-neo.
Okay, little more info. I've got a bunch of Rich Text redactor fields in my setup, and removing any blocks containing those fields seems to alleviate this particular issue. So I think this may be related to #44
from craft-neo.
Unfortunately I'm still unable to reproduce this issue. I've tried on the same version of Chrome on both Windows and OSX, and with a variety of different rich text fields, and I can't get it to trip up. I have released a new version (1.3.4) which has made changes to the way resources are loaded for blocks, so it's possible this could solve the issue, but I doubt it. Nevertheless, give it a try and let me know how it goes.
from craft-neo.
Just posted on Slack... should've checked here first. I have the latest version 1.3.4 and I get it on Chrome. Not Firefox or Safari, just Chrome. I had this happen once on another site, but it eventually went away. In both cases I suspect it started when I added a dropdown field(after weeks without issue), then changed the options in the dropdown field(including the default value). Ended up removing the field(dropdown) from Neo completely, no change.
on MAMP with php7 all browsers and craft most recent versions.
from craft-neo.
Just to clarify, I also had RichText fields in my NEO, but the issue only popped up once I added and started messing around with a dropdown.
from craft-neo.
I can confirm Neo 1.3.4 and Chrome 52.0.2743.116 prompts when leaving and a dropdown / select is present. I can give you a DB dump if it helps @benjamminf
from craft-neo.
This is so bizzare. I've figured out what's causing it and it's so stupid.
Turns out it has something to only do with Redactor 1 & 2 (I've tried other rich text editors like Froala and it doesn't do this). It happens only when you have multiple paragraphs of content in a Redactor field, and even then it only happens in some situations (which I haven't quite pinpointed yet...)
This is such a weird bug, and I'm honestly at a loss as to how and why this is happening. My best guess is that after Redactor is initialised, and after Craft has taken a snapshot of the values on the page, it's changing the value of the field in some subtle way. Like, maybe it's trimming some white-space or something. I dunno, I guess this is just another reason for Craft to finally ditch Redactor.
Anyway, at least I've been able to replicate it.
from craft-neo.
@benjamminf Can you point out in the codebase on where it may be happening/conflicting with Redactor? I might be able to fit in some troubleshooting this week to help out.
Small edit, cause I realize if you knew where, you'd have it fixed. Duh.
from craft-neo.
@ianshea thanks for the offer, but I've figured it out. My guess was correct - Redactor is filtering out white-space which is playing with the modification detection script. Neo actually has it's own modification detection, which is used to bypass saving individual blocks if they haven't changed. This was getting tricked, which caused it to change a hidden "modification flag" field, which in turn tricked Craft's own modification detection.
Aaaanyway, I just moved where Neo takes it's snapshot to after this white-space removal, and now it's all working 👍
from craft-neo.
Related Issues (20)
- How to approach eager-loading in Craft 5 HOT 4
- Neo block queries return duplicate child blocks HOT 8
- [Craft 5] Action Menu won't open after a new Block is added HOT 3
- Craft keeps showing "Unsaved Changes" upon saving of an entry with Neo fields HOT 1
- Getting Invalid Field Layout Error in CP HOT 1
- Change section and site in content migration: Neo blocks lost HOT 4
- Copy / Paste of Neo Blocks HOT 1
- Javascript Error When Trying to Add a Block in Neo HOT 2
- Settings menu for fields in the layout designer not opening in Craft 5 HOT 2
- benf\neo\elements\Block::useMemoized(): Argument #1 ($use) must be of type Illuminate\Support\Collection|array|bool, benf\neo\elements\db\BlockQuery HOT 1
- Conditional asset fields not saving values after switching condition HOT 1
- [5.x] Error after changing field handle: Field is not included in the available field layouts HOT 5
- Entries from another site can be selected in the back end, but they are not output in Twig templates. HOT 2
- Entry condition applied even for single pages HOT 3
- Duplicate entries appear in `orders` yaml files when deleting block types HOT 1
- Infinite loop in the cms. Auto saving the draft before the entry is manually saved causes the loop HOT 5
- Blocks > EntryTypes HOT 4
- Neo blocks disappear after saving draft as new entry HOT 2
- "A server error occurred." Notice when adding a global neo block. HOT 1
- Error 500: There was a problem getting the parent element. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craft-neo.