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

Migration tools don't allow adding columns with default == NULL

    Details

      Description

      Many MODS interact with custom profile fields. When upgrading from a mod to an extension, these extensions will want to manipulate the profile field data.

      The sql_prepare_column_data function, accessible to the migration tools, currently doesn't allow for column data that assigns the default value of a column to NULL. This is necessary because the save_profile_field in includes\acp\acp_profile.php does allow for this (and uses it by default).

      In other words: it is currently impossible to insert/manipulate profile fields data to the same degree as in acp_profile.php, because the perform_schema_changes cannot be used to create columns the correct way (with default == NULL).

        Issue Links

          Activity

          Hide
          nickvergessen Joas Schilling added a comment -

          I think the db_tools does not allow adding that and I think it had a reason.

          Show
          nickvergessen Joas Schilling added a comment - I think the db_tools does not allow adding that and I think it had a reason.
          Hide
          PayBas PayBas added a comment -

          Is it a security thing, or because the different DBMS handle NULL differently?

          If so, then wouldn't this function be a potential problem too? https://github.com/phpbb/phpbb/blob/develop-ascraeus/phpBB/includes/acp/acp_profile.php#L1195

          I ended up simply copy-pasting the entire add_field_ident() function into my migration script, because that seemed to be the only way to add the correct columns to the phpbb_profile_fields_data table. But of course that's not an ideal situation .

          Show
          PayBas PayBas added a comment - Is it a security thing, or because the different DBMS handle NULL differently? If so, then wouldn't this function be a potential problem too? https://github.com/phpbb/phpbb/blob/develop-ascraeus/phpBB/includes/acp/acp_profile.php#L1195 I ended up simply copy-pasting the entire add_field_ident() function into my migration script, because that seemed to be the only way to add the correct columns to the phpbb_profile_fields_data table. But of course that's not an ideal situation .
          Hide
          Senky Senky added a comment -

          This can be set to Closed, since PR is merged.

          Show
          Senky Senky added a comment - This can be set to Closed, since PR is merged.

            People

            • Assignee:
              nickvergessen Joas Schilling
              Reporter:
              PayBas PayBas
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development