Skip to content
This repository was archived by the owner on Nov 26, 2017. It is now read-only.

Removed bug producing insert from JSessionStorageDatabase::write()#454

Closed
ghost wants to merge 1 commit intostagingfrom
unknown repository
Closed

Removed bug producing insert from JSessionStorageDatabase::write()#454
ghost wants to merge 1 commit intostagingfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Oct 21, 2011

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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));

@elkuku
Copy link
Copy Markdown
Contributor

elkuku commented Nov 2, 2011

Checkstyle error details:
libraries/joomla/session/storage/database.php:120, 121
Tabs must be used to indent lines; spaces are not allowed

libraries/joomla/session/storage/database.php:121
Expected "if (...)\n"; found "if (...) "

libraries/joomla/session/storage/database.php:122 - 129
Tabs must be used to indent lines; spaces are not allowed

@joomla-jenkins
Copy link
Copy Markdown

Build triggered by changes to the base.

Test log missing. Tests failed to execute.
Checkstyle analysis reported 233 warnings and 4165 errors.

@joomla-jenkins
Copy link
Copy Markdown

Build triggered by changes to the base.

Test log missing. Tests failed to execute.
Checkstyle analysis reported 235 warnings and 11 errors.

@eddieajau
Copy link
Copy Markdown
Contributor

Any followup on this issue?

@chdemko
Copy link
Copy Markdown
Contributor

chdemko commented Feb 22, 2012

@garyamort The pull request cannot be merged

@AmyStephen
Copy link
Copy Markdown
Contributor

@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

@ghost
Copy link
Copy Markdown
Author

ghost commented May 15, 2012

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.

@ghost
Copy link
Copy Markdown
Author

ghost commented May 15, 2012

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.
#1209

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants