General developer forum

Escape column name in Tools e.g. Replace Tool

 
Picture of Matteo Scaramuccia
Escape column name in Tools e.g. Replace Tool
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Hi Everyone,
when reading https://github.com/e-lang/moodle-mod_elang/issues/67 I thought it would be best to let Moodle properly manage column names in its tools, starting from the Replace Tool.

Any thought?

A WIP PR is available in https://github.com/scara/moodle/compare/f4a2d69...m34_WIP_Properly_Escape_Column_Names_Reserved_Words_Proof.

HTH,
Matteo

 
Average of ratings: -
Renaat
Re: Escape column name in Tools e.g. Replace Tool
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Moodle checks and warns for (mis)use of reserve words : /admin/tool/xmldb/index.php?action=view_reserved_words

  • Field - elang_check->user (postgres, oracle, mssql)
  • Field - elang_cues->begin (mssql)
  • Field - elang_cues->end (postgres, mssql)
  • Field - elang_cues->number (oracle)


 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Escape column name in Tools e.g. Replace Tool
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Hi Renaat,
thanks for your prompt reply approve Yes!

Correct: but that report doesn't prevent you to keep on using reserved words in a plug-in code (especially when using *) and one could think that at most the plug-in will be affected; in that github issue, a "bad" plug-in could prevent database scan based tools to complete their work.

HTH,
Matteo

 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Escape column name in Tools e.g. Replace Tool
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Hello Everyone,
find another plugin playing w/ reserved words: https://github.com/markn86/moodle-mod_customcert/issues/123.

  • Should I file an issue into the Tracker to propose there my WIP above? I think I'd go for it but I'd like to get some attention here for the proposal.
  • Is MDLSITE-5170 valuable enough to get some votes?

TIA,
Matteo

 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Escape column name in Tools e.g. Replace Tool
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
Should I file an issue into the Tracker to propose there my WIP above? I think I'd go for it but I'd like to get some attention here for the proposal.

FYI: MDL-59635.

HTH,
Matteo

 
Average of ratings: -