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

Edit cropped image shows modal with empty & missing fields #60

Open
despecial opened this issue Jan 16, 2018 · 4 comments
Open

Edit cropped image shows modal with empty & missing fields #60

despecial opened this issue Jan 16, 2018 · 4 comments

Comments

@despecial
Copy link

despecial commented Jan 16, 2018

ACF Pro Version 5.6.7
Advanced Custom Fields: Image Crop Add-on Version 1.4.12

When trying to edit the added image in a post, the modal looks like this:
https://i.imgur.com/X2qp1gZ.png

no errors in console. any ideas?

@despecial
Copy link
Author

Project still supported?

@nelsonamaya82
Copy link

Same here, is this plugin still being supported? Does anyone have any fix/workaround for this?

@nelsonamaya82
Copy link

Well, I found the culprit.

It seems to be an issue with the option "Hide cropped images from media dialog" under Settings -> Media -> ACF Image Crop Settings. If it's enabled, then the admin won't see the cropped versions in the media dialog, however when this option is enabled, the user is not able to edit the cropped images from the post edit page.

Once I unchecked this option, the edit works fine. The only drawback is that the admin will see all the images in the media dialog, including the cropped versions.

@fine-G
Copy link

fine-G commented Feb 25, 2019

Has anyone a bugfix for this problem?
I think this function should called with other arguments
add_filter('ajax_query_attachments_args', array($this, 'filterMediaQuery'));

or a change here in the argument function:
function filterMediaQuery($args){
// get options
$options = get_option( 'acf_image_crop_settings' );
$hide = ( isset($options['hide_cropped']) && $options['hide_cropped'] );

`
// If hide option is enabled, do not select items with the acf_is_cropped meta-field
if($hide){
$args['meta_query']= array(
array(
'key' => 'acf_is_cropped',
'compare' => 'NOT EXISTS'
)
);
}
return $args;
}

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

3 participants