how to fix some att. categories bugs with ACF field
-
I am using ACF plugins to create custom articles, which have an image field block that can upload the images, but sometimes when I click the edit button of the image, it will show the text box of the Att. Categories and Att. Tags, instead of the normal “<- Click to toggle”-> showing checkbox table. Also, it will show the full checkbox table of Att. Categories without clicking the “<- Click to toggle”, and it will lose the Att. Categories’ data even you checked the box and click the save button.
how can I fix it?
and which PHP file I can modify to fix that issue?ps. I activated the debug mode, but it doesn’t have any error in the error log
-
Thanks for your report. I have just run a test with the latest versions of ACF free version and MLA and reproduced at least part of the issue you reported.
I created a new Post containing an ACF Gallery to which I added one image. I clicked the “Edit Image” pencil icon and the “Edit Image” popup window opened. When the popup first opens the taxonomy fields show up as text boxes. If I close and reopen the Edit Image popup the problem goes away. With the popup open I can also click the “Edit Image” link to the right of the thumbnail, then click the “Back” button and the problem is resolved.
I have not seen the other problems you reported; automatic opening of the checklist and losing updated terms.
I will investigate further and post an update her when I know more. If you have specific steps that demonstrate the other two problems I can try them as well.
Thanks for your report, any additional details you might have and for your interest in the plugin.
My further testing revealed a defect in the way MLA initializes the “Click to Toggle” handling in some of the ways the Edit Media popup window is opened. The issue is not specific to ACF; it happens with some core functions as well.
I have uploaded a new MLA Development Version dated 20220121 that contains a fix for your issue. You can find step-by-step instructions for using the Development Version in this earlier topic:
PHP Warning on media upload with Polylang
Once the Development Version is installed you can rerun your ACF gallery editing tests. The updated code will be part of my next MLA version, but in the interim it would be great if you could install the Development Version and let me know if it works for you. Thanks for uncovering and reporting this MLA defect.
okay, thanks a lot, I will have a test.
by the way, the att. categories’s “?Search” function in Media > addnew page(media-new.php) is not working. It only works in some pop-up windows.
-
This reply was modified 2 years, 10 months ago by
stwong00.
update: the fixing is working,
but also find out there are other bugs in uploading images via the gallery block or image block (pop-up window), sometimes the uploading image cannot be selected and the media library in the pop-up window is not refreshing immediately(do not show the image you just uploaded, need to click “Upload Files” and click back “Media Library” or reopen the pop-up window to see the latest image you just upload)Thank you for taking the time to install the Development Version and confirm that the fix I applied is working for you.
You wrote “ the att. categories’s “?Search” function in Media > addnew page(media-new.php) is not working. It only works in some pop-up windows.” I have run additional tests and I cannot reproduce this issue. The “? Search” function is working in the Media/Add New Bulk Edit Area, the Media/Assistant Bulk Edit Area and on the Media/Edit Media full screen editing page. Can you tell me if the text box does not open for you or if the text you enter in the text box is not limiting the results? Any additional details would be helpful.
You wrote “there are other bugs in uploading images via the gallery block or image block (pop-up window)” I have not been able to reproduce this issue on my system. There are several ways to upload new images for these blocks. Can you give me the steps you followed to cause the problem?
Thanks for your understanding and your help.
about the att. Categories issue, it shows the textbox, but it does not limit any result when you type some word in the textbox.
about the image uploading issue, I am using the ACF plugin’s image field and slideshow field (which is WordPress classic editor’s outlook), when you click add image button, it will pop out a new window, it contains “Media Library” to select the image and “Upload Files”.
when you upload the image via the “Upload Files”.
In a normal uploading case (inactivated MLA plugin), the image will be shown at the top left corner of Media Library and also be selected, and you can click the “select” button at the bottom right to pick the image.
when activating the MLA, you still can upload the image, but it won’t show the image at the top left corner of Media Library and also can not click the select button, you need to click the “Upload Files” tab, and re-click the “Media Library”, then it will show images correctly.
Thankshere is the pop-up window screencap:
https://ibb.co/Y7xV5kyThanks for your update with the additional information; very helpful.
On my system the “? Search” function is working everywhere. Does it work for you in the Media/Assistant Bulk Edit Area and on the Media/Edit Media full screen editing page? If you use the browser’s Developer Tools are there any JavaScript errors in the console?
I have been able to reproduce the image uploading issue by following the steps you outlined; thank you. The problem only occurs in the ACF Image and WYSIWYG Gallery popups; the WordPress blocks are working fine.
I will investigate further, but I also found a work around you may be able to use. When the popup opens, simply drag the new file over the “Media Library” thumbnails area and drop it there instead of using the Uploads tab. On my system, if you use the Media Library tab with the drag & drop technique everything is working well.
Thanks again for your help and your patience.
hi, sorry for late reply, I have tested on the Media/Assistant Bulk Edit Area and on the Media/Edit Media full-screen editing page,
Media/Assistant Bulk Edit Area is not working too,
but the Media/Edit Media full-screen editing page is working.and your tricks of the images uploading are working too, thanks a lot.
Thanks for your update with the additional information and the good news regarding the workaround I suggested. I spent more time trying to find and fix the ACF-specific issue that omits the thumbnail of a new upload from the attachments grid in the Media Library tab. I found this comment in the ACF JavaScript code which hints at a possible cause:
// this is super wack! // if you add _acfuploader to the options.library args, new uploads will not be added to the library view. // this has been traced back to the wp.media.model.Query initialize function (which can't be overriden) // Adding any custom args will cause the Attahcments to not observe the uploader queue // To bypass this security issue, we add in the args AFTER the Query has been initialized // options.library._acfuploader = settings.field;
I am afraid that any fix I undertake would be complex and could have unintended side affects that are worse than the existing problem. For this reason I have decided to leave things as they are for now. I did find one other workaround; clicking the “Search” button (without entering any search text) will refresh the grid and show the new upload.
Regarding the “? Search” function, I still cannot reproduce your issue, but I have gone over the code and made a number of small changes that might correct the problem. For example, I replaced some deprecated JQuery syntax that may have caused a runtime error.
I have uploaded a new MLA Development Version dated 20220207 that contains the updated code. As before, you can find step-by-step instructions for using the Development Version in this earlier topic:
PHP Warning on media upload with Polylang
Once the Development Version is installed you can rerun your “? Search” tests. The updated code will be part of my next MLA version, but in the interim it would be great if you could install the Development Version and let me know if it works for you. Thanks for your patience and understanding while I worked on these issues.
I have released MLA version 2.99, which contains the fixes developed for this topic. I noticed that the topic is marked Resolved, so I hope the last Development Version resolved the “? Search” issues.
I am leaving the topic Resolved, but please update it if there are any remaining issues to investigate and address. Thanks for working with me on this topic.
oh, I tried the last version, but the “?search” in add new page is still not working
Thanks for your update. I regret that the changes made in my latest version have not resolved the “? Search” issue for you.
Since I have not been able to reproduce the problem on my system I will need more help from you if you want to keep working on this issue. It will be much easier to communicate by email for the work required. I will post a summary here when the process is completed. Please contact me at my web site if you are able to work with me to investigate further. Thanks for your understanding and your patience.
-
This reply was modified 2 years, 10 months ago by
- The topic ‘how to fix some att. categories bugs with ACF field’ is closed to new replies.