Refactor VoteStorageService to use poll_id instead of block_id #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces major improvements to testing safety and database management, as well as critical bug fixes for the ContentPoll plugin. The most significant changes ensure that running tests can no longer delete production vote data, with robust protections and documentation for safe test execution. Additionally, the release notes in
CHANGELOG.mddetail a series of critical bug fixes and architectural changes across recent versions, particularly focused on preventing data loss during migrations and plugin updates.Testing Safety and Documentation Improvements:
PHPUNIT_TESTconstant, database migration safeguards, and explicit checks for test database prefixes or a confirmation flag.run-tests.sh) supporting both safe and explicit truncation modes, and added comprehensive testing documentation (TESTING.md,tests/README.md,docs/TEST-DATABASE-SETUP.md). [1] [2]test_*,phpunit_*), or if explicitly confirmed by the user.README.mdwith clear instructions for safe test execution and database safety configuration.Database and Migration Robustness:
DatabaseManagerclass using the singleton pattern, and moved initialization to theplugins_loadedhook with semantic versioning for migration tracking.Block Attribute and Asset Updates:
pollIdattribute to the vote block, further decoupling poll identity from the internalblockIdand supporting future enhancements. [1] [2]Changelog and Release Notes:
CHANGELOG.mdwith detailed entries for versions 0.7.0 through 0.7.6, documenting all critical fixes, architectural changes, and new features, as well as providing links for version comparisons. [1] [2]Test Result Artifacts:
.phpunit.cache/test-resultsto reflect the expanded and improved test coverage.These changes collectively make the plugin much safer to develop and test, while also improving the maintainability and reliability of database migrations and poll identity handling.