acf-star-rating-field icon indicating copy to clipboard operation
acf-star-rating-field copied to clipboard

doesn't work with latest ACF Pro 6.0.2

Open andsat opened this issue 3 years ago • 9 comments

error in console:

jquery.min.js:2 jQuery.Deferred exception: Cannot read properties of undefined (reading '0') TypeError: Cannot read properties of undefined (reading '0') at initialiseField (http://local.test/wp-content/plugins/acf-star-rating-field/js/input.js:10:38) at HTMLDivElement.<anonymous> (http://local.test/wp-content/plugins/acf-star-rating-field/js/input.js:75:4) at Function.each (http://local.test/wp-includes/js/jquery/jquery.min.js:2:3003) at s.fn.init.each (http://local.test/wp-includes/js/jquery/jquery.min.js:2:1481) at http://local.test/wp-content/plugins/acf-star-rating-field/js/input.js:74:11 at http://local.test/wp-content/plugins/advanced-custom-fields-pro/assets/build/js/acf-input.min.js:1:2262 at o (http://local.test/wp-content/plugins/advanced-custom-fields-pro/assets/build/js/acf.min.js:1:1417) at Object.doAction (http://local.test/wp-content/plugins/advanced-custom-fields-pro/assets/build/js/acf.min.js:1:587) at n.doAction (http://local.test/wp-content/plugins/advanced-custom-fields-pro/assets/build/js/acf.min.js:1:18166) at HTMLDocument.<anonymous> (http://local.test/wp-content/plugins/advanced-custom-fields-pro/assets/build/js/acf.min.js:1:27130) undefined

andsat avatar Oct 07 '22 17:10 andsat

I'm experiencing the same issue. Looks like something goes wrong with the SVG rendering as well. Is this plugin still maintained @kevinruscoe ? It's a very helpful piece of code 😀

dhunink avatar Oct 07 '22 19:10 dhunink

Doesn't work with ACF non-pro either, and seems to be now crashing ACF admin interface.

I started looking at it, and there is a function render_field which creates a

I think this issue is for all of ACF 6. The javascript needs to fail in a way it doesn't cause the javascript to fail.

MGParisi avatar Nov 03 '22 07:11 MGParisi

https://github.com/kevinruscoe/acf-star-rating-field/blob/3166fd5dd35c2efa9580ec01d433832e7d9b1fbb/StarRatingField.php#L102

MGParisi avatar Nov 03 '22 08:11 MGParisi

Also, SVG's work for me. That is incorrect. Only the SVG's from Font-Awesome are not working (according to the ticket)

MGParisi avatar Nov 03 '22 08:11 MGParisi

Maybe a full fix?

This fixes the admin interfaces from crashing for ACF6. https://github.com/MGParisi/acf-star-rating-field

I'm uncertain if there is more. It's working for me now on ACF6 non-pro again. Though, I'm only using it on the front end.

MGParisi avatar Nov 03 '22 09:11 MGParisi

@MGParisi Hey, I'll take a look at this over the weekend and hopefully get it fixed.

kevinruscoe avatar Nov 04 '22 09:11 kevinruscoe

I'm sorry, but I can't replicate the issues.

I've just installed:

  • WP 6.1
  • ACF
  • this plugin (from the master branch).

I made a simple star field and created a minimal theme

<?php 

wp_head();

while(have_posts()) {
    
    the_post();

    the_title();

    print get_field('star');

}

wp_footer();

And all 3 return types (number, list and FA list) work.

Can you guys provide more context, please?

kevinruscoe avatar Nov 05 '22 10:11 kevinruscoe

Hi @kevinruscoe,

I've just come across this issue as well. For me, it was working up until trying to duplicate items in the field group. At that point, after refreshing, I was no longer able to edit fields until disabling the plugin.

jarrod-colluco avatar Nov 09 '22 14:11 jarrod-colluco

@jarrod-collective Check out my fork, it resolves the issues. https://github.com/MGParisi/acf-star-rating-field

MGParisi avatar Nov 17 '22 13:11 MGParisi