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

Upgrading from 3.0.12 to 3.1.1 does not display moderator soft delete permissions

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.1.2-RC1
    • Component/s: ACP
    • Labels:
      None
    • Environment:
      PHP 5.5.1.8, PostgreSQL 9.3.5, x86_64-redhat-linux-gnu (Fedora 20), Firefox 31.0, on localhost

      Description

      When upgrading from 3.0.12 to 3.1.0, moderator permissions for SOFT DELETE do not appear in the Administration Control Panel.

      Please see discussion at: https://www.phpbb.com/community/viewtopic.php?f=466&t=2270566 (SOFT DELETE moderator permission after 3.0.12 upgrade)

        Activity

        Hide
        P_I P_I added a comment -

        I'm the OP of the discussion Lady_G links. Here is more information from my further investigation.

        I've worked my way through the database a bit and think I have figured out the database changes. Here's what my new phpBB 3.1 database shows.

        mysql> SELECT * 
        FROM phpbb_acl_options
        WHERE auth_option LIKE  "%_softdelete";
        +----------------+--------------+-----------+----------+--------------+
        | auth_option_id | auth_option  | is_global | is_local | founder_only |
        +----------------+--------------+-----------+----------+--------------+
        |             31 | f_softdelete |         0 |        1 |            0 |
        |             43 | m_softdelete |         1 |        1 |            0 |
        +----------------+--------------+-----------+----------+--------------+
        

        So checking the other acl* tables to see where m_softdelete is assigned,

        mysql> SELECT *
        FROM phpbb_acl_roles_data AS d, phpbb_acl_roles AS r
        WHERE auth_option_id =43
        AND d.role_id = r.role_id;
        +---------+----------------+--------------+---------+-------------------+-------------------------------+-----------+------------+
        | role_id | auth_option_id | auth_setting | role_id | role_name         | role_description              | role_type | role_order |
        +---------+----------------+--------------+---------+-------------------+-------------------------------+-----------+------------+
        |      10 |             43 |            1 |      10 | ROLE_MOD_FULL     | ROLE_DESCRIPTION_MOD_FULL     | m_        |          3 |
        |      11 |             43 |            1 |      11 | ROLE_MOD_STANDARD | ROLE_DESCRIPTION_MOD_STANDARD | m_        |          1 |
        |      12 |             43 |            1 |      12 | ROLE_MOD_SIMPLE   | ROLE_DESCRIPTION_MOD_SIMPLE   | m_        |          2 |
        +---------+----------------+--------------+---------+-------------------+-------------------------------+-----------+------------+
        

        On my upgraded 3.0.12 database there are matches for the 1st query, which give me auth_option_id = 121 for m_softdelete. When I run the 2nd query using this value I get a NULL set as the result.

        I don't really know where to starting check in the code, but it seems that something in the upgrade procedure isn't adding the necessary entries.

        Show
        P_I P_I added a comment - I'm the OP of the discussion Lady_G links. Here is more information from my further investigation. I've worked my way through the database a bit and think I have figured out the database changes. Here's what my new phpBB 3.1 database shows. mysql> SELECT * FROM phpbb_acl_options WHERE auth_option LIKE "%_softdelete"; +----------------+--------------+-----------+----------+--------------+ | auth_option_id | auth_option | is_global | is_local | founder_only | +----------------+--------------+-----------+----------+--------------+ | 31 | f_softdelete | 0 | 1 | 0 | | 43 | m_softdelete | 1 | 1 | 0 | +----------------+--------------+-----------+----------+--------------+ So checking the other acl* tables to see where m_softdelete is assigned, mysql> SELECT * FROM phpbb_acl_roles_data AS d, phpbb_acl_roles AS r WHERE auth_option_id =43 AND d.role_id = r.role_id; +---------+----------------+--------------+---------+-------------------+-------------------------------+-----------+------------+ | role_id | auth_option_id | auth_setting | role_id | role_name | role_description | role_type | role_order | +---------+----------------+--------------+---------+-------------------+-------------------------------+-----------+------------+ | 10 | 43 | 1 | 10 | ROLE_MOD_FULL | ROLE_DESCRIPTION_MOD_FULL | m_ | 3 | | 11 | 43 | 1 | 11 | ROLE_MOD_STANDARD | ROLE_DESCRIPTION_MOD_STANDARD | m_ | 1 | | 12 | 43 | 1 | 12 | ROLE_MOD_SIMPLE | ROLE_DESCRIPTION_MOD_SIMPLE | m_ | 2 | +---------+----------------+--------------+---------+-------------------+-------------------------------+-----------+------------+ On my upgraded 3.0.12 database there are matches for the 1st query, which give me auth_option_id = 121 for m_softdelete. When I run the 2nd query using this value I get a NULL set as the result. I don't really know where to starting check in the code, but it seems that something in the upgrade procedure isn't adding the necessary entries.
        Hide
        beer man beer man added a comment -

        I have the same problem: localhost running PHP 5.4.19, MySql 5.5.32.

        Upgraded by replacing all forum files and running update.

        Navigate to:

        Permissions --> Global Moderators --> Global Moderators (Select) --> Edit Permissions --> Advanced Permissions --> Misc Tab.

        The Misc tab only displays:

        Can manage bans
        This setting is only assigned globally. It is not forum based.
        Can view post details
        Can issue warnings
        This setting is only assigned globally. It is not forum based.

        Show
        beer man beer man added a comment - I have the same problem: localhost running PHP 5.4.19, MySql 5.5.32. Upgraded by replacing all forum files and running update. Navigate to: Permissions --> Global Moderators --> Global Moderators (Select) --> Edit Permissions --> Advanced Permissions --> Misc Tab. The Misc tab only displays: Can manage bans This setting is only assigned globally. It is not forum based. Can view post details Can issue warnings This setting is only assigned globally. It is not forum based.
        Hide
        Lady_G Lady_G added a comment - - edited

        I repeated the upgrade process from 3.0.12 to 3.1.1. There is no change in the result.

        This bug now applies to 3.1.1, I modified the bug title and affected versions.

        Show
        Lady_G Lady_G added a comment - - edited I repeated the upgrade process from 3.0.12 to 3.1.1. There is no change in the result. This bug now applies to 3.1.1, I modified the bug title and affected versions.
        Hide
        P_I P_I added a comment -

        In phpBB3/install/schemas/schema_data.sql, I'm thinking that following code

        INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_softdelete', 1, 1);

        and

        # Full Moderator (m_)
        INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 10, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%';
         
        # Standard Moderator (m_)
        INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 11, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option NOT IN ('m_ban', 'm_chgposter');
         
        # Simple Moderator (m_)
        INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 12, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option IN ('m_', 'm_delete', 'm_softdelete', 'm_edit', 'm_info', 'm_report');
        


        sets up/enables the "Can soft delete posts" on the Misc tab of Global Moderator Permissions.

        If I check phpbb/db/migration, and check where m_softdelete is mentioned

        fgrep -r m_softdelete *
        data/v310/softdelete_p1.php:                    array('permission.add', array('m_softdelete', false)),


        Should the last argument be true to match the base install which sets acl_options.is_global=1 WHERE auth_option="m_softdelete"?

        More importantly, there doesn't appear to be any code that inserts data into the acl_roles_data table. Shouldn't the above INSERT statements (or equivalent) be executed somewhere in softdelete_p1.php or softdelete_p2.php?

        Show
        P_I P_I added a comment - In phpBB3/install/schemas/schema_data.sql, I'm thinking that following code INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ( 'm_softdelete' , 1, 1); and # Full Moderator (m_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 10, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' ;   # Standard Moderator (m_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 11, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option NOT IN ( 'm_ban' , 'm_chgposter' );   # Simple Moderator (m_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 12, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option IN ( 'm_' , 'm_delete' , 'm_softdelete' , 'm_edit' , 'm_info' , 'm_report' ); sets up/enables the "Can soft delete posts" on the Misc tab of Global Moderator Permissions. If I check phpbb/db/migration, and check where m_softdelete is mentioned fgrep -r m_softdelete * data/v310/softdelete_p1.php: array('permission.add', array('m_softdelete', false)), Should the last argument be true to match the base install which sets acl_options.is_global=1 WHERE auth_option="m_softdelete"? More importantly, there doesn't appear to be any code that inserts data into the acl_roles_data table. Shouldn't the above INSERT statements (or equivalent) be executed somewhere in softdelete_p1.php or softdelete_p2.php?
        Hide
        prototech prototech added a comment -

        The permissions are not added to the roles on upgrade so as to not grant permissions without the administrator's knowledge.

        Show
        prototech prototech added a comment - The permissions are not added to the roles on upgrade so as to not grant permissions without the administrator's knowledge.
        Hide
        Lady_G Lady_G added a comment -

        I just discovered I cannot soft delete posts as an administrator.

        Permissions --> Global Permissions --> Administrators --> Administrator group --> Advanced --> Misc. has no entry for soft delete. I am unable to soft delete a post.

        Please check that administrators can soft delete a post.

        Show
        Lady_G Lady_G added a comment - I just discovered I cannot soft delete posts as an administrator. Permissions --> Global Permissions --> Administrators --> Administrator group --> Advanced --> Misc. has no entry for soft delete. I am unable to soft delete a post. Please check that administrators can soft delete a post.
        Hide
        prototech prototech added a comment -

        The permission in question is a moderator permission and not an administrator permission so it will not be listed under the global administrator permissions. If you wish to grant this permission (once 3.1.2 is released and this fix is included), then the course of action would be Permissions -> Global Permissions -> Group Permissions - select Administrators group - submit. In the "Select type" dropdown, choose Global Moderator permissions, which will list moderator permissions. Or just add administrators to the Global Moderators group.

        Show
        prototech prototech added a comment - The permission in question is a moderator permission and not an administrator permission so it will not be listed under the global administrator permissions. If you wish to grant this permission (once 3.1.2 is released and this fix is included), then the course of action would be Permissions -> Global Permissions -> Group Permissions - select Administrators group - submit. In the "Select type" dropdown, choose Global Moderator permissions, which will list moderator permissions. Or just add administrators to the Global Moderators group.

          People

          • Assignee:
            prototech prototech
            Reporter:
            Lady_G Lady_G
          • Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development