Moodle

$url cannot be null for Oracle in datalib.php add_to_log

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.7.7, 1.8.10, 1.9.6, 2.0
  • Fix Version/s: 1.7.7+, 1.8.11, 1.9.7, 2.0
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Database:
    Oracle
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE

Description

Oracle treats the empty string as a NULL and so fails the NOT NULL requirement.

$url defaults to the empty string and so hits this problem.
$info also had this problem but was fixed in
revision 1.348

add_to_log just needs a similar fix for $url, i.e.

if ($CFG->type = 'oci8po') { 
 	  	         if (empty($info)) {
 	  	             $info = ' ';
 	  	         }
+	  	         if (empty($url)) {
+	  	             $url = ' '; 
+	  	         }
 }

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Resolving as fixed, now all versions from 1.7 to 2.0 are handling empty $info and $url properly.

Thanks for the report and ciao

Show
Eloy Lafuente (stronk7) added a comment - Resolving as fixed, now all versions from 1.7 to 2.0 are handling empty $info and $url properly. Thanks for the report and ciao

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: