Good to hear from you again, and thanks for the positive feedback on MLA.
I assume the problem has something to do with the way Envira processes uploads and attaches items to the post/page containing the Envira gallery. I have no experience with Envira but I found these themes on the WordPress Repository:
StartKit By Nayra Themes
Envira By Nayra Themes (a Child Theme of StartKit)
Are you using the free version of these themes or the Pro versions? If I can reproduce the problem with the free versions I can investigate further.
It would also help to know the steps you follow when “creating an envira gallery”. Thanks for any additional details you can provide.
Hi David.
We are using GeneratePress Premium (Theme), free version available on WordPress Repository https://ernst-wilhelm-grueter.de/wp-admin/theme-install.php?theme=generatepress Envira Gallery Pro, free version available on WordPress Repository https://ernst-wilhelm-grueter.de/wp-admin/plugin-install.php?s=Envira%20Gallery&tab=search&type=term
The issue can be reproduced with the free versions.
creating an envira gallery
* using gutenberg block editor
* create new post
* enter post title
* add envira gallery block by entering /envira
* upload pictures by using the upload option within the gallery block
* enter post category
* enter featured image, choose on from the already uploaded
* publish post
Additional observation: The plugin synched, unsynched ‘views’ in the Posts submenu. Synched should show children in blue and unsynched should show children in red. It seems to me it is somehow the other way round.
In my case synched shows 11 posts, but 10 of 11 are showing red children, one is showing children in blue.
Thanks for your updates with the additional information. The failure to synch on uploads is because of a WordPress update a while back that changed the way uploads are processed. It has nothing to do with Envira Gallery.
I have fixed that defect and uploaded a new MLA Development Version dated 20211116 that contains the corrected code. 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 must update the example plugin. Navigate to the Settings/Media library Assistant Documentation tab and click the “Example Plugins” button. Type “smart” in the text box and click “Search Plugins” to filter the table.
You are looking for the “Smart Media Categories” plugin. Find that plugin and hover over the title in the left-most column. Click the “Update” rollover action, then verify that you have the latest version 1.1.7 installed and active.
Once the Development Version and updated example plugin are installed and active you can re-test the upload process. 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 the example plugin and let me know if they work for you. Thanks for your patience while I developed this solution.
I am still working on your additional observation regarding the synched/unsynched views. I will post an update when I have progress to report.
Hi David. Thank you very much for this solution. Works perfect for me !!!
I have another question, not sure if it is already in your suite of plugins or easy to do or simply doesn’t fit to your approach. Is it possible (during the processing of the smart media categories) to trigger the execution of a mapping rule, for instance of the attachment description. I want to give the users the different opportunity to search parent post title information via a free text search and via a structured dropdown list (MLA UI Elements Example).
Thanks for your update confirming the success of the changes made in the Development Version. Thanks as well for your generous contribution to our Chateau Seaview Fund at the Golden West Chapter of the ALS Association in support of the MLA plugin; very much appreciated!
I have a fix for the “synched/unsynched views” issue you reported, but I will delay updating the Development Version while I investigate your latest question/suggestion.
The MLA mapping rules do, of course, run in many of the same actions that trigger processing of the smart media categories (SMC) rules, e.g., when uploading a new attachment. However, SMC-specific actions such as the “Synch All Children” button and “Smart Media” rollover/popup action do not trigger the MLA mapping rules. When you write “(during the processing of the smart media categories)“, are these the actions you are referring to? If so, I will investigate the work required to add that capability to SMC. Let me know if I have understood your suggestion correctly; thanks.
Good Morning.
In my last comment I was not really precise. Apart from SMC core functionality I am interested in accessing parent post title, parent categories and parent tags within mapping rule for the attachment description. Ideally without additional user action.
***
When playing with ‘MLA Substitution Parameter Hooks Example’ I am trying to access parents post title the intermediate title “Auto Draft” is put into the description field template:([+parent:post_title+]), ([+parent_title+]), ([+parent_terms:category+])
No parent category is shown though I choose a term.
Take my apologies. I have not refreshed my knowledege about this plugin by reading any blog conversation.
Thanks for the clarification and the template text; very helpful.
I did some testing and reproduced your results. The mapping rules are run at the end of the upload process, and the “Auto Draft” result comes from WordPress saving an empty draft post just to reserve its ID value for later use. There is no easy way to change the MLA logic to defer or rerun the mapping rules later, when the post is published with its final values.
There is, however, an easy workaround that gives the results you want. A small modification of the process you outlined in your earlier post:
- using gutenberg block editor
- create new post
- enter post title
- enter post category
- click “Save Draft” in the upper-right corner of the page
- add envira gallery block by entering /envira
- upload pictures by using the upload option within the gallery block
- enter featured image, choose on from the already uploaded
- publish post
You can add the Envira Gallery block before or after you save the draft. Just make sure you click “Save Draft” before uploading any images to the gallery. I hope you will find this workaround useful because updating MLA does not look feasible at this point. Thanks for your understanding.
By the way, I have uploaded a new Development Version dated 20211122 that contains a fix for the “synched/unsynched views” issue you reported. You can follow the steps I outlined in my earlier post to install the Development Version and update your Smart Media Categories example plugin. If you give that a try, let me know if it resolves the issue for you.
I have released MLA version 2.99, which contains the fixes developed for this topic.
I am marking the topic resolved, but please update it if you have any problems or further questions regarding the updates to the Smart Media Categories example plugin. Thanks for working with me on this topic.