Skip to content

Conversation

@soderlind
Copy link
Owner

This pull request addresses an issue where folder counts in the sidebar were not updating correctly after rule-based folder assignment during media uploads. The update ensures that the UI accurately reflects folder assignments immediately after uploads, improving user experience and integration reliability. Additionally, it introduces a dedicated upload handler script, updates documentation, and bumps the plugin version.

Media upload and folder refresh improvements:

  • Added a new media-upload.js script that hooks into the WordPress media uploader to explicitly call vmfRefreshFolders() and refresh the sidebar counts after rule-based folder assignment, using a debounce to batch updates.
  • Enqueued the new upload handler script only on the media library admin page via the enqueue_media_upload_script method in Plugin.php. [1] [2] [3] [4]
  • Updated the folder assignment logic to immediately update term counts and clean the object term cache, ensuring the UI reflects changes without delay.
  • Added and updated unit tests to confirm the new behavior for term count updates and cache cleaning after folder assignment.

Documentation and versioning:

  • Updated the changelog, readme, and plugin version to 1.1.2, documenting the bug fix and improvements. [1] [2] [3] [4] [5]
  • Added a detailed integration proposal in docs/parent-plugin-integration-proposal.md to guide future enhancements and add-on compatibility.

- Updated CHANGELOG.md to document the fix for folder counts not updating in the sidebar after rule-based folder assignment on upload.
- Bumped version in package.json, readme.txt, and vmfa-rules-engine.php to 1.1.2.
- Added media upload script (build/media-upload.js) to refresh media library after uploads.
- Created media upload asset file (build/media-upload.asset.php) for script dependencies.
- Integrated media upload handler in Plugin.php to enqueue the new script on the media library page.
- Enhanced RuleEvaluator.php to update term count and clean object term cache immediately after folder assignment.
- Updated tests in RuleEvaluatorTest.php to ensure new functionality is covered.
- Added parent plugin integration proposal documentation for better add-on interaction.
@soderlind soderlind merged commit 28685c0 into main Jan 22, 2026
3 checks passed
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

Successfully merging this pull request may close these issues.

1 participant