-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EZP-30754: Fixed handling always available flag for ContentInfo update #2850
Merged
alongosz
merged 5 commits into
ezsystems:6.13
from
alongosz:ezp-30754-fix-handling-contentinfo-always-available-update
Dec 5, 2019
Merged
EZP-30754: Fixed handling always available flag for ContentInfo update #2850
alongosz
merged 5 commits into
ezsystems:6.13
from
alongosz:ezp-30754-fix-handling-contentinfo-always-available-update
Dec 5, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alongosz
force-pushed
the
ezp-30754-fix-handling-contentinfo-always-available-update
branch
from
November 4, 2019 08:45
050bc8d
to
307d99b
Compare
alongosz
force-pushed
the
ezp-30754-fix-handling-contentinfo-always-available-update
branch
3 times, most recently
from
November 13, 2019 10:25
ccc2b42
to
54a1995
Compare
adamwojs
approved these changes
Nov 21, 2019
mikadamczyk
approved these changes
Nov 21, 2019
Doctrine Query builder allows easy check if there's anything to update before running a query.
eZ\Publish\SPI\Persistence\Content\ContentInfo::alwaysAvailable should be Boolean instead of Integer
alongosz
force-pushed
the
ezp-30754-fix-handling-contentinfo-always-available-update
branch
from
November 29, 2019 11:23
2313d0a
to
1f00ac5
Compare
mikadamczyk
approved these changes
Nov 29, 2019
alongosz
added a commit
to alongosz/ezpublish-kernel
that referenced
this pull request
Dec 2, 2019
1 task
micszo
approved these changes
Dec 4, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retested first and second issue on eZ Platform EE v1.13.5 with this branch.
Used the draft PR to test on 2.5.
alongosz
deleted the
ezp-30754-fix-handling-contentinfo-always-available-update
branch
December 5, 2019 11:16
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
6.13
,7.5
,master (8.0@dev)
This PR fixes two separate issues, related to handling of the always available flag, which occur during ContentInfo (Content metadata) update.
The first issue is about updating only the always available flag and nothing else, as reported via kaliop-uk/ezmigrationbundle#209 and EZP-30754.
To solve that we need to check if there's anything to update before trying to execute database update.
It's not easy with our own database abstraction layer, therefore this PR refactors
\eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase::updateContent
to rely on\Doctrine\DBAL
QueryBuilder for that.The second issue is about fixing erroneous type casting when setting always available flag, both in Legacy Storage Persistence Content Mapper and in the
Content\Gateway\DoctrineDatabase::updateAlwaysAvailableFlag
method. The latter mistake causedContentInfo::alwaysAvailable
being always set totrue
during main Translation update, regardless of the actual state.Implemented also integration tests covering both updating main translation and always available flag only. Those are the special cases handled by different path of code.
QA
The second issue is reproducible only on the API level unfortunately. Content Info after updating main language code (via
ContentMetadataUpdateStruct
) has always available flag always set to true.To see the bug you could use
app:test
command available on my 1.13-based branch: https://github.com/alongosz/ezplatform/tree/ezp-30754-cmd-for-qa(observe that
alwaysAvailable
changes though updateStruct didn't touch it).TODO:
is_hidden
column (777d30f#diff-92b3a16009ff423f5d87182e80ea7dcaR304).\eZ\Publish\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase
)updateContent
method to rely on\Doctrine\DBAL
Query Builder.updateContent
method.updateAlwaysAvailableFlag
.$ composer fix-cs
).