Skip to content
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-29096: Do not store empty draft values in DB #1417

Merged
merged 12 commits into from
Mar 11, 2019
Merged
Prev Previous commit
Next Next commit
Update kernel/classes/datatypes/ezuser/ezusertype.php
Co-Authored-By: pkamps <pkamps@mugo.ca>
glye and pkamps authored Feb 20, 2019
commit 78d897cf371c0d4ce76e88d073d977ccdcd41eeb
2 changes: 1 addition & 1 deletion kernel/classes/datatypes/ezuser/ezusertype.php
Original file line number Diff line number Diff line change
@@ -259,7 +259,7 @@ function storeObjectAttribute( $contentObjectAttribute )

// saving information in the object attribute data_text field to simulate a draft
// only if the object version is a draft (status == 0)
if(
if (
$user->Login &&
$contentObjectAttribute->attribute( 'object_version' )->attribute( 'status' ) == 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$contentObjectAttribute->attribute( 'object_version' )->attribute( 'status' ) == 0
$contentObjectAttribute->attribute( 'object_version' )->attribute( 'status' ) === 0

Or can this be a string? I would not think so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope you don't mind if I ignore it. Maybe it's a string and then it would hurt to be extra strict here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We ought to be strict, strictly speaking ;) eZContentObjectVersion says it's an integer. But I see many cases where we aren't strict, so I guess this can pass if others agree.

)