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

Language key used when soft-deleting in MCP.

    Details

      Description

      The success message after soft-deleting a post through the MCP is "POST_DELETED_SUCCESS" instead of the translated string for that key.

      The problem results from this line in mcp_main.php:

      		$success_msg = (sizeof($post_info) == 1) ? 'POST_DELETED_SUCCESS' : 'POSTS_DELETED_SUCCESS';

      All the functions in mcp_main.php seem to follow this same structure where $success_msg is ultimately used in the following manner:

      trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link);

      mcp_delete_post() on the other hand expects $success_msg to have the string translated by the time that trigger_error() is called:

      trigger_error($success_msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . '<br /><br />' . implode('<br /><br />', $return_link));

        Activity

        Hide
        nickvergessen Joas Schilling added a comment -

        trigger_error performs user->lang() on the string.
        Maybe the file with the string is not loaded previously?

        Show
        nickvergessen Joas Schilling added a comment - trigger_error performs user->lang() on the string. Maybe the file with the string is not loaded previously?
        Hide
        prototech prototech added a comment -

        Correct, but there is a mixture of various strings when calling it in, so relying on that behavior doesn't work in this situation. The code snippets above are not actually the full line, heh. Should be:

        trigger_error($success_msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . '<br /><br />' . implode('<br /><br />', $return_link));

        Show
        prototech prototech added a comment - Correct, but there is a mixture of various strings when calling it in, so relying on that behavior doesn't work in this situation. The code snippets above are not actually the full line, heh. Should be: trigger_error($success_msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . '<br /><br />' . implode('<br /><br />', $return_link));

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development