protected function updateContextMessages($entity, &$context) { $messages = publisher_get_messages(); foreach ($messages as $type => $type_messages) { foreach ($type_messages as $message) { if ($entity instanceof Entity) { $context['results'][] = array('type' => $type, 'message' => $message, 'entity_type' => $entity->type(), 'entity_id' => $entity->id()); } else { $context['results'][] = array('type' => $type, 'message' => $message, 'entity_type' => '', 'entity_id' => ''); } } } }
/** * Overrides the Drupal goto. * * @param string $path The original path the goto was going to. */ public function overrideGoto(&$path) { // Set the original destination and messages. $this->original_destination = $path; $this->original_messages = publisher_get_messages(); $this->ready_to_override = false; $path = 'publisher/begin'; // Store the transaction session back to the session. $this->storeToSession(); }