#42 Fix time stamping of new unmarked/unpublished articles

Merged
fox merged 1 commits from jsoares/master into fox/master 1 year ago
jsoares commented 1 year ago

New articles are being created with last_marked and last_published set to the current time, regardless of having been marked or published, due to bad comparison of $marked (0/1) with string 'true'.

Fixed comparison and set 'NULL' string in case not marked/published.

Tested with latest TT-RSS 17.12, PHP 5.6.32, MySQL 5.7.20.

New articles are being created with last_marked and last_published set to the current time, regardless of having been marked or published, due to bad comparison of $marked (0/1) with string 'true'. Fixed comparison and set 'NULL' string in case not marked/published. Tested with latest TT-RSS 17.12, PHP 5.6.32, MySQL 5.7.20.
fox commented 1 year ago
Owner

Thanks for the fix, but why use string 'NULL' instead of proper null value?

Thanks for the fix, but why use string 'NULL' instead of proper null value?
jsoares commented 1 year ago
Poster

These parameters are not bound on execute but concatenated with the query string (line 956); the null value would not concatenate. I assume this was because of the 'NOW()'.

I see no reason not to move to the same construct as used for $last_read_qpart (lines 928-934), i.e. use date()/null and bind. It would look a little more elegant/consistent. For the bug fix, thought it better to minimise changes.

These parameters are not bound on execute but concatenated with the query string (line 956); the null value would not concatenate. I assume this was because of the 'NOW()'. I see no reason not to move to the same construct as used for $last_read_qpart (lines 928-934), i.e. use date()/null and bind. It would look a little more elegant/consistent. For the bug fix, thought it better to minimise changes.
fox commented 1 year ago
Owner

right, this makes sense. i'll make a mental note to rework this using date() and a bound parameter later.

right, this makes sense. i'll make a mental note to rework this using date() and a bound parameter later.
This pull request has been merged successfully!
Sign in to join this conversation.
No Label
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.