Project

General

Profile

Bug #7563

Error while clicking on the Payment configuration

Added by kaisheng chew over 4 years ago. Updated about 4 years ago.

Status:
Bug resolved
Priority:
Normal
Category:
Plugins
Target version:
Start date:
02/03/2015
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

After click Payment configuration,
bring me to the page that shown

Parse error: syntax error, unexpected '[' in /home/absingap/public_html/eforex/plugin/buycourses/src/buy_course.lib.php on line 53


Files

Snap 2015-03-02 at 20.51.28.png (78.8 KB) Snap 2015-03-02 at 20.51.28.png kaisheng chew, 02/03/2015 13:53

Associated revisions

Revision aad2bca3 (diff)
Added by Yannick Warnier about 4 years ago

Fix db issues in buy_course plugin - refs #7563

History

#1

Updated by Jérôme Warnier over 4 years ago

  • Subject changed from After click to Error while clicking on the Payment configuration
#2

Updated by Yannick Warnier over 4 years ago

  • Target version set to 1.10.0
#3

Updated by Julio Montoya about 4 years ago

  • Status changed from New to Needs more info
  • Priority changed from Immediate to Normal

When I try to activate the plugin, I have an error "Column not found: 1054 Unknown column 'c_id' in 'field list'":

$table = Database::get_main_table(TABLE_BUY_SESSION_COURSE);
$sql = "CREATE TABLE IF NOT EXISTS $table (
    id INT unsigned NOT NULL auto_increment PRIMARY KEY,
    session_id SMALLINT(5) unsigned DEFAULT '0',
    course_code VARCHAR(40),
    nbr_users SMALLINT(5) unsigned DEFAULT '0',
    sync int)";
Database::query($sql);

$tableSessionCourse = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$sql = "SELECT * FROM $tableSessionCourse";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
    $presql = "INSERT INTO $table (session_id, c_id, nbr_users)
    VALUES ('" . $row['session_id'] . "','" . $row['c_id'] . "','" . $row['nbr_users'] . "')";
    Database::query($presql);

This table should use the c_id and not course_code.

I don't know who is in charge of this plugin.

#4

Updated by Julio Montoya about 4 years ago

  • Assignee set to Yannick Warnier
#5

Updated by Yannick Warnier about 4 years ago

  • Category set to Plugins
  • Status changed from Needs more info to Bug resolved
  • % Done changed from 0 to 100

kaisheng, this is due to a new php 5.4 syntax. Chamilo 1.10.0 is the first version to abandon support for PHP 5.3.
This is fixed by upgrading PHP. See 3rd bullet point in http://php.net/manual/en/migration54.new-features.php

This, however, should not be a requirement in Chamilo 1.9.10. Thank you for reporting.

Also available in: Atom PDF