Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-12263

\phpbb\db\migration\tool\module.php contains several errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.1.0-b1
    • 3.1.0-a3
    • None

      	/** @var dbal */
      	protected $db;

      Invalid class dbal, should be \phpbb\db\driver\driver

      * @param mixed $cache

      Parameter $cache of the contructor should be \phpbb\cache\service in the doc block as it is type casted anyway

      Parameter $include_path of method add() is unused, Should it be used? it's used in the remove() method

      remove():
      The fetched field does not match any selected column.
      Also the variable module_name is unused later, therefor we could just remove the query from the else all together:

      			else
      			{
      				$module = (int) $module;
      				$sql = 'SELECT module_langname
      					FROM ' . $this->modules_table . "
      					WHERE module_id = $module
      						AND module_class = '" . $this->db->sql_escape($class) . "'
      						$parent_sql";
      				$result = $this->db->sql_query($sql);
      				$module_name = $this->db->sql_fetchfield('module_id');
      				$this->db->sql_freeresult($result);
       
      				$module_ids[] = $module;
      			}

      EXreaction can you have a look?

            nickvergessen Joas Schilling
            nickvergessen Joas Schilling
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: