kgiszewski / Archetype

Archetype is an Umbraco 7 property editor that wraps other installed property editors.
https://github.com/kgiszewski/ArchetypeManual
MIT License
89 stars 54 forks source link

Cannot Read Property "Fieldsets" on Drag if External Rich Text Editors #362

Closed Nicholas-Westby closed 7 years ago

Nicholas-Westby commented 8 years ago

I get this error when I drag a fieldset and there is an Archetype property in another tab.

console-error

code-error

For the search engines, that error message is:

Uncaught TypeError: Cannot read property 'fieldsets' of undefined

Archetype 1.13.0. Umbraco 7.4.3. Probably related to the nested dragging feature I implemented: https://github.com/imulus/Archetype/issues/355

I might be able to tackle this in a few days, but thought I'd report it in case you have time and others need a quicker fix.

Nicholas-Westby commented 8 years ago

FYI, based on the stack trace, the problem starts here:

origin

Nicholas-Westby commented 8 years ago

Now that I think about it, it might be a problem with rich text editors outside of Archetype rather than Archetypes in other tabs. Not sure. Will have to look into further.

Nicholas-Westby commented 8 years ago

Yeah, pretty sure it's with rich text editors outside of Archetype rather than Archetypes in other tabs. I bet if we modify the "rteClass" to include a selector to ensure it's a rich text editor inside of an Archetype, that would fix the issue.

Nicholas-Westby commented 8 years ago

Note that adding the extra class wouldn't necessarily catch all instances, as there could be a property editor inside of Archetype that itself contains a rich text editor, but it would at least be as effective as the previous implementation prior to 1.13.0.

If interested, you could also add a check to see if the rich text editor is immediately under an Archetype property. Also, some defensive coding could be added so that null is returned from getFieldset() rather than have it throw an error (obviously, code that calls that function would also need to account for the possibility of a null).

Nicholas-Westby commented 8 years ago

I'll start working on a pull request for this.

Nicholas-Westby commented 8 years ago

Pull request here: https://github.com/imulus/Archetype/pull/364

kjac commented 7 years ago

@Nicholas-Westby as I recall, this was resolved with your PR. I'm closing the issue now, feel free to reopen it if I'm mistaken.

Nicholas-Westby commented 7 years ago

@kjac Yep, it's fixed and the PR has been merged, but I don't think it's been released as a new Archetype version yet.

kjac commented 7 years ago

@Nicholas-Westby thanks. We're putting together a new release soon :)