History | Log In     View a printable version of the current page.  
We are currently focused especially on Moodle 2.0, Moodle 1.9.x bugs and Moodle 1.9.x testing.    Confused? Lost? Please read this introduction to the Tracker.
Issue Details (XML | Word | Printable)

Key: MDL-14877
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Petr Škoda
Reporter: Eloy Lafuente (stronk7)
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Moodle
MDL-14679

prefix check shouldn't be perfomed by moodle_database classes

Created: 17/May/08 06:55 AM   Updated: 22/May/08 08:27 AM
Component/s: Database SQL/XMLDB
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: Eloy Lafuente (stronk7) and Petr Škoda
Security Level: None


 Description  « Hide
Right now prefix rules are executed by the xxx_yyy_moodle_database constructor.

That causes 2 problems:

1) force ALL db to fulfil the rules (not only Moodle DB, but auth/enrol....)
2) print_error() output is 100% broken, because a lot of stuff hasn't been defined (lang, themes....)

IMO those checks should continue where they are now (admin/index.php), simply preventing any Moodle installation, but not making the dml/ddl stuff dependent of that.

Ciao :-)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Škoda - 17/May/08 08:00 PM
1/ oh - the only problem might be reserved words in temp and externale talbes - my +1 to revert this
2/ sure

Eloy Lafuente (stronk7) - 18/May/08 04:51 AM
Fixed. Working. Ciao :-)

Petr Škoda - 18/May/08 05:56 AM - edited
Thinking a bit more about this I would really like to get all those get_dbfamily() out - this looks like a step backwards :-(

We could add a new moodle_database method or a new constructor parameter $testprefix=true, then we could choose to test it (or not) and the admin/index.php and CLI installer would not be polluted with dbfamily specific stuff again.

Eloy Lafuente (stronk7) - 18/May/08 09:41 AM
Well,

we were discussing time ago about get_family() being public or no. And finally agree about to leave them public because could be needed in some places.

IMO this is exactly the type of place where it can be used. They are only two simple and stopper checks in the right place.

Sincerely, I think it's a lot more polluting to add new parameters to constructor and so. I think that moodle_databases shouldn't perform those tests conditionally at all. As a last chance... I see them in another public method:

$DB->check_prefix_rules()

or so, but leaving, in any case constructors free for that sort of conditional stuff.

Ciao :-)

Eloy Lafuente (stronk7) - 22/May/08 08:26 AM
Not the best solution IMO (the external attribute on constructor) but works.

Committed some days ago in MDL-14864. Resolving as fixed.