The Platform needs to decouple the JUser class from the JTable class #276

Closed
cozimek opened this Issue Aug 22, 2011 · 7 comments

6 participants

@cozimek

Specifically, the following lines in /libraries/joomla/database/table/content.php are problematic (according to Louis Landry): 247, 253, 266. Thanks to Louis for tracking this down at Joomla!Day South Africa 2011 with me.

Cheerio,
Ryan

@elinw

Has this been cleaned up in the meantime?

@LouisLandry

The issue is that the JTable bone is connected to the JUser bone ... and the JUser bone is connected to the JSession bone... and in a CLI application where you may want to edit/store content but don't have a session this causes problems. We need a way to inject a JUser object into JTable classes to be used instead of calling JFactory::getUser(). Perhaps something like JTable::setUser(JUser $user). It can still default to asking the factory, but there should be an option to inject the user dependency.

@elinw

oooo I missed he session part.

@elinw

Louis,

Should the user just be set to null if there is no user specifically available (either JUser or set explicitly in the application or a default user? Should there be any cases besides the user table where you have to have a userId and get an exception if you don't? I was looking in JContent and it uses the idea of a default user as a fall back but what if there is no default? I guess I mean to what extent is/should the platform (as opposed to application) setting required fields?

@fastslack

Possible fix b2ecaa8

@eddieajau

I'm sorry but we aren't accepting issues for this repository any more. Please see http://developer.joomla.org/cms/report-an-issue.html for how to report and issue for the CMS Platform.

@eddieajau eddieajau closed this Apr 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment