MLA errors when using plugin
-
Each time I click “Assistant” under Media in the Dashboard, I get errors. Exactly 2 errors, both with the same time stamp.
The error is:
“PHP Warning: Invalid argument supplied for foreach() in /nfs/webroot/html/wp-content/plugins/media-library-assistant/includes/class-mla-data.php on line 3055”I don’t see any plugin misbehavior, but these entries are a distraction when I monitor my PHP error log. What can I do to get rid of these errors?
Thanks for your help!
https://www.ads-software.com/plugins/media-library-assistant/
-
Thanks for your report and for including the full text of your error messages; very helpful.
Line 3055 is part of the code analyzing the “where-used” information for the items in the Media/Assistant submenu table. In the current MLA version, this part of the code runs even if you disable all of the “where-used” categories. I will fix that in my next release, and I appreciate learning about it from your report. I will update this topic when the fix is posted to the MLA Development Version here in the Repository so you can get some interim relief.
The real answer is that you have two Media Library items with non-empty, non-array values in the “sizes” element of the “Attachment Metadata” (
image_meta
) array. The “sizes” array usually has values for the “thumbnail”, “medium” and other intermediate image sizes.If you can find the damaged items I would be very interested in what their Attachment Metadata looks like. You can see this towards the bottom of the Media/Edit Media screen. You may have other problems with these items, so finding them and fixing or deleting them may be in order.
I will update this topic when I have a new MLA version you can try. If you do more investigation to find the damaged items I would be interested in any additional information you can provide. Thanks for your interest in the plugin.
I have uploaded a Development Version that avoids the “PHP Warning” message for damaged
sizes
arrays. The Development Version also avoids running the analysis code when all four “where-used” categories are disabled.If you’d like to give it a try, let me know if you need detailed instructions to get it uploaded to your site. I will leave this topic unresolved until the fixes go out in an official MLA version.
Thanks for your patience.
Hi, David. Thanks for the quick response!
I’ll give the Development Version a try, so please do send instructions. I looked for a download, and didn’t find it.
I very much appreciate your plugin. I have almost 500 objects in my Media Library, and Media Library Assistant makes a quick find easy!
Thanks for the good words and for your willingness to try the Development Version. To get it, follow these steps:
- Go to the Developers tab of the Media Library Assistant entry in the Repository.
- Scroll down to the “Other Versions” section and click “Development Version”.
- Download the ZIP archive to your computer, somewhere you can find it.
- Login to your site’s Admin area and navigate to Plugins/Installed Plugins.
- Find Media Library Assistant and deactivate it.
- Find Media Library Assistant and delete it. You will not lose any settings.
- Go to Plugins/Add New.
- Click “Upload Plugin”, to the right of the Add Plugins title.
- “Browse…” to the location of the ZIP Archive and click on it.
- Click “Install Now”, to the right of “Browse…”
- When the install completes, click “Activate Plugin” at the bottom of the screen.
- When the activation completes, scroll down to “Media Library Assistant” and look for a date like “20150130” at the start of the Description. That’s how you know you have a Development Version.
That’s it. I don’t change the version number of the Development Version, so you will be notified when the next official version comes out and the normal update process will continue to work.
Let me know how the Development Version works for you.
The development version has resolved the problem. No more error messages when clicking “Assistant.” Thank you very much for this great plugin, and also for your very quick resolution of this problem.
I’ll still locate the two offending objects to help you analyze what happened.
I have released MLA version 2.02, which contains the code to avoid the “PHP Warning” message for damaged sizes arrays. The new version also avoids running the analysis code when all four “where-used” categories are disabled.
I am marking this topic resolved, but please update it if you have any problems or questions regarding these enhancements in the new version.
Thanks for your help and your interest in the plugin.
Great, now it works like a charm.
Thanks a lot for introducing reading out XMP tags.
Knut,
I have re-posted your good news to the topic it belongs in:
Thanks for your update.
Hi David!
I could use your help on this topic. We would like to have something like the alphabets menu and alphabetized adjacent posts like you see here: https://www.bushcraftvereniging.nl/wiki/bannock-2/
Specifically, I’m referring to the alphabetical post menu and the previous/next post links by alphabet. I’d like to use this at https://www.SpaceStudent.org/companies which is basically an Industry Directory. Please keep in mind that the issues listed above, like avoiding alphabetizing based on articles (like “the”, and “an”) do not apply here because we’re only working with company nanes.
As we expand the Industry Directory, we would also like to do things like list all the news posts related to a company below the company description section of the single post.
If you look at one of the single company pages, you will see that there are a number of other issues… like the fax field label and the social media icons display, even if no content for these fields has been entered in the admin. There could be like a checkbox to display the icon or not, or better, it could simply be aware if the field was empty and not show the icon/label if there’s not any data there.
BTW, we asked the current developer to use the Pods Admin framework, which we are happy with because later we can easily add fields, etc. into the custom posts… but I mention it because, if you’re going to do some work for us, you may need to work within that framework. It’s not dealbreaker… just wanted you to be aware.
SO, take a look and let us know if you’re able and interested to help… and how you like to structure work with newbie clients like us.
All the best! dd
Thanks for your query, the site links and the details on your application needs. I am not sure why you added them to this topic instead of starting a new topic with a more specific title.
I have read your description and looked at the sites you gave links to. I believe I understand what you want, but I do not see how the Media Library Assistant plugin can help you. The first part of your application, “ alphabetical post menu and the previous/next post links by alphabet“, reminds me of this earlier MLA support topic:
Conditional display of elements like your icon/label can be done in the context of an
[mla_gallery]
shortcode using Content Templates, as in this earlier topic:However, these topics and techniques work in the context of Media Library items such as images because, well, that is the purpose and scope of Media Library Assistant. It looks like your application questions are regarding posts, pages and custom post types. If I understand that correctly, I am not sure how MLA can help.
I hope you will appreciate that developing MLA and supporting its users is a full-time (volunteer) job. I do not have the time required to take on general WordPress development tasks or projects. If MLA can be of use to your application I am happy to help you make it a success. If not, I thank you for your interest and wish you complete success with your project.
Thank you David! I appreciate your feedback and totally understand about your dedication to MLA and the associated time constraints. Yes, you’re right… I found the alphabetical pagination link in doing a general wordpress search for help on my interests. Again, thank you for taking a look and of course, when/if the general goals of MLA are more in line with our needs, I’ll be in touch. Thank you again! dd
- The topic ‘MLA errors when using plugin’ is closed to new replies.