Moodle

XMLDB editor should check for inconsistent default values

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.1, 2.0
  • Fix Version/s: 2.0
  • Component/s: Administration
  • Labels:
    None
  • Database:
    Any
  • Affected Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

The XMLDB editor should have a check for inconsistent default values for fields. I've found several instances where they have been wrong, and it can cause some really subtle errors.

Activity

Hide
Howard Miller added a comment -

Can now check for inconsistent/missing defaults.

Show
Howard Miller added a comment - Can now check for inconsistent/missing defaults.
Hide
Petr Škoda (skodak) added a comment -

Pretty please next time file the bug in advance before committing stuff into cvs, ideally before you start working on something
1/ it gives anybody chance to review it - both the code and the general idea
2/ it helps with commit synchronisation of commits

Show
Petr Škoda (skodak) added a comment - Pretty please next time file the bug in advance before committing stuff into cvs, ideally before you start working on something 1/ it gives anybody chance to review it - both the code and the general idea 2/ it helps with commit synchronisation of commits
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Howard,

while the idea is good... I think current implementation is slightly imperfect (in fact I've checked it doesn't work under PostgreSQL at all, and I guess it won't work under MSSQL and Oracle either).

So I'm going to revert your changes in MOODLE_19_STABLE while leaving them under HEAD. Just today we are going to introduce major changes under HEAD (related to handling databases) and the idea will be usable there...

I second Petr's comments, specially in the 19_STABLE release (it's not the best target to introduce new functionalities so quickly).

Ciao

P.S: Reopening this bug and addressing it for 2.0

Show
Eloy Lafuente (stronk7) added a comment - Hi Howard, while the idea is good... I think current implementation is slightly imperfect (in fact I've checked it doesn't work under PostgreSQL at all, and I guess it won't work under MSSQL and Oracle either). So I'm going to revert your changes in MOODLE_19_STABLE while leaving them under HEAD. Just today we are going to introduce major changes under HEAD (related to handling databases) and the idea will be usable there... I second Petr's comments, specially in the 19_STABLE release (it's not the best target to introduce new functionalities so quickly). Ciao P.S: Reopening this bug and addressing it for 2.0
Hide
Howard Miller added a comment -

oops....

Sorry, for recklessness

Having thought about it some more, I wonder if it makes sense to do a single check that makes sure the database schema is correct in as many respects as possible. We've had a quite a few mysterious bugs that come back to database problems (been upgrading since 1.3.something).

Ok - the day has come to install a Postgres version and (at least) make this work with that. Can't help you with the other regrettably, but I guess there aren't so many people about with ancient databases other than MySQL or Postgres.

Cheers!

Show
Howard Miller added a comment - oops.... Sorry, for recklessness Having thought about it some more, I wonder if it makes sense to do a single check that makes sure the database schema is correct in as many respects as possible. We've had a quite a few mysterious bugs that come back to database problems (been upgrading since 1.3.something). Ok - the day has come to install a Postgres version and (at least) make this work with that. Can't help you with the other regrettably, but I guess there aren't so many people about with ancient databases other than MySQL or Postgres. Cheers!
Hide
Petr Škoda (skodak) added a comment -

I already made it work in my patch which should be committed today

Show
Petr Škoda (skodak) added a comment - I already made it work in my patch which should be committed today
Hide
Petr Škoda (skodak) added a comment -

the 'butis' lang string is, ehm, not nice at all - we must not construct sentences from strings this way

Show
Petr Škoda (skodak) added a comment - the 'butis' lang string is, ehm, not nice at all - we must not construct sentences from strings this way
Hide
Howard Miller added a comment -

I take it you would prefer something like "Current Value:' and "Expected Value"?

Show
Howard Miller added a comment - I take it you would prefer something like "Current Value:' and "Expected Value"?
Hide
Petr Škoda (skodak) added a comment -

Anything that can be translated into other languages

Show
Petr Škoda (skodak) added a comment - Anything that can be translated into other languages
Hide
Howard Miller added a comment -

Have changed the strings to 'expected' and 'actual'.

Show
Howard Miller added a comment - Have changed the strings to 'expected' and 'actual'.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: