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

new pre-posting event

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.1.0-b3
    • 3.1.11-RC1
    • Events
    • None

    Description

      An event should be triggered before a post/topic is created allowing extensions to do additional error checking and validation.
      In posting.php at line 1115 the following could be added:

      /**
           * This event is used for performing additional checks before a post/topic is created.
           *
           * The only action that should be altered is $error array.
           *
           * @event core.submit_post_end
           * @var	string		mode		The current editing mode
           * @var	array		post_data		The data submitted
           * @var	array		error                The array of errors
           * @since 3.1.0-b4
           */
          $vars = array(
              'mode',
              'post_data',
              'error',
          );
          extract($phpbb_dispatcher->trigger_event('core.submit_post_data_error_check', compact($vars)));
       
      // Store message, sync counters
      if (!sizeof($error) && $submit) ....
      

      Any additional variables you think is important could be added, but for most extensions just being able to change the error variable based on the data submitted should be enough.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rfdy rfdy [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: