Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/controllers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ services:
- '@phpbb.titania.attachment.uploader'
- '@phpbb.titania.attachment.uploader'
- '@phpbb.titania.subscriptions'
- '@text_formatter.parser'
- '@text_formatter.utils'

phpbb.titania.controller.contrib.revision:
class: phpbb\titania\controller\contribution\revision
Expand Down
19 changes: 18 additions & 1 deletion controller/contribution/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ class manage extends base
/** @var \phpbb\titania\subscriptions */
protected $subscriptions;

/** @var \phpbb\textformatter\s9e\parser */
protected $parser;

/** @var \phpbb\textformatter\s9e\utils */
protected $utils;

/** @var bool */
protected $is_moderator;

Expand Down Expand Up @@ -68,15 +74,19 @@ class manage extends base
* @param \phpbb\titania\attachment\uploader $screenshots
* @param \phpbb\titania\attachment\uploader $colorizeit_sample
* @param \phpbb\titania\subscriptions $subscriptions
* @param \phpbb\textformatter\s9e\parser $parser
* @param \phpbb\textformatter\s9e\utils $utils
*/
public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \phpbb\titania\controller\helper $helper, type_collection $types, \phpbb\request\request $request, \phpbb\titania\cache\service $cache, \phpbb\titania\config\config $ext_config, \phpbb\titania\display $display, \phpbb\titania\access $access, \phpbb\titania\message\message $message, \phpbb\titania\attachment\uploader $screenshots, \phpbb\titania\attachment\uploader $colorizeit_sample, \phpbb\titania\subscriptions $subscriptions)
public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \phpbb\titania\controller\helper $helper, type_collection $types, \phpbb\request\request $request, \phpbb\titania\cache\service $cache, \phpbb\titania\config\config $ext_config, \phpbb\titania\display $display, \phpbb\titania\access $access, \phpbb\titania\message\message $message, \phpbb\titania\attachment\uploader $screenshots, \phpbb\titania\attachment\uploader $colorizeit_sample, \phpbb\titania\subscriptions $subscriptions, \phpbb\textformatter\s9e\parser $parser, \phpbb\textformatter\s9e\utils $utils)
{
parent::__construct($auth, $config, $db, $template, $user, $helper, $types, $request, $cache, $ext_config, $display, $access);

$this->message = $message;
$this->screenshots = $screenshots;
$this->colorizeit_sample = $colorizeit_sample;
$this->subscriptions = $subscriptions;
$this->parser = $parser;
$this->utils = $utils;
}

/**
Expand Down Expand Up @@ -490,6 +500,9 @@ protected function submit($authors, $old_settings)
// Set custom field values.
$this->contrib->set_custom_fields($this->settings['custom']);

// Parse the contrib name so emojis can be used
$this->contrib->contrib_name = $this->parser->parse($this->contrib->contrib_name);

// Create relations
$this->contrib->put_contrib_in_categories(
$this->settings['categories'],
Expand Down Expand Up @@ -708,6 +721,10 @@ protected function assign_vars($error)
$this->contrib->type->id
);
}

// Unparse the contrib name
$this->contrib->contrib_name = $this->utils->unparse($this->contrib->contrib_name);

$this->message->display();
$this->contrib->assign_details();
$this->display->assign_global_vars();
Expand Down