Details

    • Type: New Feature
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-b3
    • Fix Version/s: 3.1.11-RC1
    • Component/s: Events
    • Labels:
      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

            • Assignee:
              Unassigned
              Reporter:
              rfdy rfdy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: