Removed bug producing insert from JSessionStorageDatabase::write()#454
Conversation
There was a problem hiding this comment.
This is deprecated usage of JLog. You'll want to have a look at JPATH_PLATFORM/joomla/log/log.php. The syntax is something like:
<?php
JLog::add(sprintf('Session ID %s update is identical to current record', $id));|
Checkstyle error details: libraries/joomla/session/storage/database.php:121 libraries/joomla/session/storage/database.php:122 - 129 |
|
Build triggered by changes to the base. Test log missing. Tests failed to execute. |
|
Build triggered by changes to the base. Test log missing. Tests failed to execute. |
|
Any followup on this issue? |
|
@garyamort The pull request cannot be merged |
|
@garyamort - It would be good to get this fix in-it continues to be reported as an error, especially on high-volume sites. http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=28510 http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=28249 |
|
hmm, thought this was fixed in another pull request... Elin reminded me it's been sitting here. Ok, I';ll have to pull the latest code and redo the update, this time without using depreciated JLog. |
|
I re-arranged my repos into orgs for my own clarity and this branch was lost. I've recreated the fix and submitted it as pull request 1209. |
If update results in an error[such as a non existant row] then write will already return false. If however it succeeds but is identical to the current data, affectedRows will be 0, which then invokes insert while will ALWAYS fail because it is a duplicate row.
An insert is already performed when the session is created in JSession, there is no need for this one and it can only result in an error.