Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-12545

new pre-posting event

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.11-RC1
    • 3.1.0-b3
    • Events
    • None

      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.

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

              Created:
              Updated:
              Resolved: