Skip to content

Conversation

@kartikeyg0104
Copy link

Summary of Changes

This pull request fixes an issue in the SmartSearch indexer where fields like publish_end_date were not being updated to NULL in the database when the corresponding publish_down date was removed from an article. The root cause was the missing $updateNulls parameter in the $db->updateObject() method call, which prevents NULL values from being updated in the database.

The fix includes:

  • Adding the $updateNulls parameter set to true in the $db->updateObject() method call.

Testing Instructions

  1. Before applying the fix:

    • Create an article with no publish_down date → Index is correct.
    • Add a publish_down date → Index updates with the new date.
    • Remove the publish_down date → Index retains the old publish_end_date value.
  2. After applying the fix:

    • Create an article with no publish_down date → Index is correct.
    • Add a publish_down date → Index updates with the new date.
    • Remove the publish_down date → Index correctly updates publish_end_date to NULL.

Actual Result BEFORE applying this Pull Request

  • Articles with removed publish_down dates still retain the old publish_end_date in the index.

Expected Result AFTER applying this Pull Request

  • Articles with removed publish_down dates have their publish_end_date properly updated to NULL in the database.

@brianteeman
Copy link
Contributor

It is expected that you test your work BEFORE submitting a PR

You can not have tested this PR as as soon as it is applied you are not able to save any article

I appreciate that you want to contribute but PLEASE respect the time of everyone else by not submitting untested code

@richard67
Copy link
Member

System tests are failing for the same reason.

@Serge-45
Copy link

@kartikeyg0104 : the syntax simplification you added on the ternary operator lines is forcing a cast to int of the fields. That could be the reason for the fail. A syntax simplification here is probably not needed.

@HLeithner HLeithner changed the base branch from 5.3-dev to 5.4-dev October 15, 2025 17:08
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.4-dev.

@HLeithner HLeithner added the bug label Oct 15, 2025
@richard67
Copy link
Member

Alternative PR see #46395 .

@richard67 richard67 added the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label Nov 2, 2025
@richard67 richard67 self-assigned this Nov 2, 2025
@richard67
Copy link
Member

@kartikeyg0104 Thanks for this PR. Meanwhile we have merged another PR #46395 with the same fix for the $db->updateObject call but not the other changes which cause system tests to fail. I hope you are not disappointed, and your contribution is still appreciated as it has pointed us to the right fix.

Closing in favour of #46395 .

@richard67 richard67 closed this Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug PR-5.4-dev Updates Requested Indicates that this pull request needs an update from the author and should not be tested.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants