Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-14069

Incorrect sql_fetchfield call in style_update_p1 migration

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.5
    • Fix Version/s: 3.1.6-RC1
    • Component/s: Update system
    • Labels:
      None
    • Environment:
      PHP 5.5.9 running on ubuntu

      Description

      On this line:

      https://github.com/phpbb/phpbb/blob/3.1.x/phpBB/phpbb/db/migration/data/v310/style_update_p1.php#L164

      it says:

      			$sql = 'SELECT style_id
      				FROM ' . STYLES_TABLE . "
      				WHERE style_name = 'prosilver'";
      			$result = $this->sql_query($sql);
      			$default_style = $this->db->sql_fetchfield($result);
      			$this->db->sql_freeresult($result);
      

      I got the following error:

      Geïnstalleerde data: \phpbb\db\migration\data\v310\extensions; Tijd: 0.70 secondes
      Geïnstalleerde schema: \phpbb\db\migration\data\v310\style_update_p1; Tijd: 0.14 secondes
      PHP Warning: Illegal offset type in isset or empty in /media/marco/websitesHD/websites/unixerius/git/phpBB31/phpbb/db/driver/driver.php on line 355
      Geïnstalleerde data: \phpbb\db\migration\data\v310\style_update_p1; Tijd: 0.12 secondes
      Geïnstalleerde schema: \phpbb\db\migration\data\v310\style_update_p2; Tijd: 0.26 secondes

      This seems to trace back to the sql_fetchfield() call in line 163 mentioned above. I guess it's not $result that should be passed, but 0 or 'style_id' or sth like that?

        Activity

        Hide
        DavidIQ David Colón added a comment -

        Please open up a support request on phpbb.com/community as this is not a bug.

        Show
        DavidIQ David Colón added a comment - Please open up a support request on phpbb.com/community as this is not a bug.
        Hide
        marcovo marcovo added a comment - - edited

        Can you tell me why this is not a bug? If I search through the code, typically a string is given to sql_fetchfield(), not a query-id as is now?

        As a sidenode: The sql_fetchfield() method of the cache class does need a query-id as the first parameter, however that method also needs a second parameter, which is again the $field, just as here.

        Also see here:
        https://github.com/phpbb/phpbb/search?utf8=%E2%9C%93&q=%22function+sql_fetchfield%22

        I've changed $result into 'style_id' on my local machine and it seems to fix the issue.

        Show
        marcovo marcovo added a comment - - edited Can you tell me why this is not a bug? If I search through the code, typically a string is given to sql_fetchfield(), not a query-id as is now? As a sidenode: The sql_fetchfield() method of the cache class does need a query-id as the first parameter, however that method also needs a second parameter, which is again the $field, just as here. Also see here: https://github.com/phpbb/phpbb/search?utf8=%E2%9C%93&q=%22function+sql_fetchfield%22 I've changed $result into 'style_id' on my local machine and it seems to fix the issue.
        Hide
        marcovo marcovo added a comment -

        Corrected the sql_fetch_field() call in style_update_p1 migration.
        Changed $result into 'style_id'

        Show
        marcovo marcovo added a comment - Corrected the sql_fetch_field() call in style_update_p1 migration. Changed $result into 'style_id'

          People

          • Assignee:
            bantu Andreas Fischer
            Reporter:
            marcovo marcovo
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development