Hube2 / acf-medium-editor

Configurable Medium Editor WYSIWYG Field for ACF5 Pro
77 stars 10 forks source link

If I use a Medium Editor Field can't update the ACF group #24

Closed JMarqz closed 6 years ago

JMarqz commented 6 years ago

Using the Versión 5.7.0 of ACF Pro if I use a Medium Editor Field can't update the ACF group.

On the JS console show this: An invalid form control with name='acf_fields[146][custom_buttons][acfcloneindex][name]' is not focusable. (The "146" I think it depends on the ID field)

If deactivate the plugin everything works fine.

Using de Version 2.4.2 of the plugin. Tested on Chrome (67.0.3396.99)

Hube2 commented 6 years ago

I will need to look into this, not sure what the issue is.

Hube2 commented 6 years ago

I'm seeing several problems with this plugin with ACF 5.7.0. As of now if you are already using this plugin on a site then you'll need to revert to ACF 5.6.10 until I get the issues worked out, or you'll need to work out a different solution.

JMarqz commented 6 years ago

Thanks @Hube2, I'll make the downgrade!

Hube2 commented 6 years ago

The first hurdle that I'm dealing with is the nested repeater that I'm using for the custom button settings. It's just not working at all. I have submitted a ticket in the ACF Pro repo to see if this is a bug of not.

But I'm thinking that I need to change how this operates. This is what I'm thinking.

Rather than creating custom buttons for each instance (which I've found to be a PITA on one of the sites I use this on because I have to duplicate these buttons over and over again) I could create an options page where all of the custom buttons are created. Then instead of building the buttons in the instance you could select which ones to use with a checkbox field. This would make it somewhat easier to use for people that recreate buttons and solve many of the issues with the plugin that stem from the use of this repeater/nested repeater as a field setting.

Currently I'm thinking about how I would upgrade from the old system to this possibly new one.

If anyone has thoughts on this let me know.

Hube2 commented 6 years ago

A new version of ACF was released yesterday. Can you test to see if there are still issues and if you run into anything let me know. I've done some testing and everything seems to be working, however, I don't know if I tested every possibility.

elliott-impression commented 6 years ago

Hi @Hube2, I am running WordPress 4.9.7 alongside the latest versions of ACF and Medium Editor - but I still having the same issue where a Field Group does not save.

In this particular Field Group, I have, in addition the Medium Editor...:

I hope this helps debug!

Note also, when you add the Medium Editor field, the group does save. But once you edit the field group again, it doesn't save.

Thank you

Hube2 commented 6 years ago

Can you export the field group to json and attach it here so that I can test and hopefully see the issue that you are seeing.

Hube2 commented 6 years ago

This is very strange. I can add a medium editor field but I cannot update a field group that already contains a medium editor field, the update button just fails to do anything. If I remove the field it works. If I change the field to a different type of field it works. But if there is an existing medium editor field nothing.... and no JS errors.

Hube2 commented 6 years ago

Removing the repeater field for custom buttons corrects the issue with saving.

So I think I'm going to go with my original thought to remove this and work out a different way to do them. I just need to figure out how to get any currently created custom button into the new system so that I don't break any sites.

Hube2 commented 6 years ago

I just published a new version here and on WP and I think it corrects the problems. Can you please test and let me know.

Hube2 commented 6 years ago

Has anyone been able to try the new version with ACF5.7.1?

elliottmangham commented 6 years ago

Hey @Hube2, sorry I wasn't able to test sooner. This is working for me now!

Thank you 👏

Hube2 commented 6 years ago

The issue with not being able to save had to do with required fields in the repeater. In older versions of ACF I set them as required, but ACF did not check them validation did not work for field settings. Now it works for most fields but with a repeater it triggers an error on an empty repeater. This is only when used as a field setting and not with the use of repeaters in general. Since required field settings did not really work in the past all of the fields have extra checking to look for empty values anyway so I was able to fix it by simply setting them to not be required.

elliottmangham commented 6 years ago

I managed to have a nosey at your commits and noticed this was the issue. Took some investigating but at least it was ultimately a simple fix!

Thanks again @Hube2. Me & my clients couldn't live without this plugin!