Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few fixes for 2.0 #3281

Merged
merged 6 commits into from Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions composer.json
Expand Up @@ -36,10 +36,10 @@
"ext-gd": "*",
"ext-curl": "*",
"ext-mysqli": "*",
"ext-fileinfo": "*"
"ext-fileinfo": "*",
"ext-exif": "*"
},
"suggest": {
"ext-exif": "*",
"ext-recode": "*",
"ext-openssl": "*",
"ext-ctype": "*",
Expand All @@ -58,8 +58,8 @@
"ext-dom": "*",
"ext-mcrypt": "*",
"ext-apache": "*",
"ext-imagick": "*",
"ext-iconv": "*"
"ext-iconv": "*",
"ext-imagick": "*"
},
"require-dev": {
"phpunit/phpunit-selenium": "~4.1",
Expand Down
3 changes: 1 addition & 2 deletions sources/ElkArte/AbstractController.php
Expand Up @@ -177,8 +177,7 @@ public function getHook()
if ($this->_hook === '')
{
// Use the base controller name for the hook, ie post
$this->_hook = explode('\\', trim(get_class($this), '\\'));
$this->_hook = end($this->_hook);
$this->_hook = $this->getModuleClass();

// Initialize the events associated with this controller
$this->_initEventManager();
Expand Down
2 changes: 1 addition & 1 deletion sources/ElkArte/AdminController/ManageAttachments.php
Expand Up @@ -842,7 +842,7 @@ public function action_repair()
'files_without_attachment' => 0,
);

$to_fix = !empty($this->_req->session->attachments_to_fix) ? $this->_req->session->attachments_to_fix : array();
$to_fix = !empty($_SESSION['attachments_to_fix']) ? $_SESSION['attachments_to_fix'] : array();
$context['repair_errors'] = $this->_req->getSession('attachments_to_fix2', $context['repair_errors']);
$fix_errors = isset($this->_req->query->fixErrors) ? true : false;

Expand Down
2 changes: 0 additions & 2 deletions sources/ElkArte/AdminController/ManagePermissions.php
Expand Up @@ -582,7 +582,6 @@ public function action_quick()
validateToken('admin-mpq', 'quick');

// we'll need to init illegal permissions, update permissions, etc.
require_once(SUBSDIR . '/Permission.subs.php');
require_once(SUBSDIR . '/ManagePermissions.subs.php');

// Make sure only one of the quick options was selected.
Expand Down Expand Up @@ -810,7 +809,6 @@ public function action_modify2()
validateToken('admin-mp');

// We'll need to init illegal permissions, update child permissions, etc.
require_once(SUBSDIR . '/Permission.subs.php');
require_once(SUBSDIR . '/ManagePermissions.subs.php');

$current_group_id = (int) $this->_req->query->group;
Expand Down
14 changes: 7 additions & 7 deletions sources/ElkArte/Modules/Attachments/Post.php
Expand Up @@ -66,13 +66,12 @@ public static function hooks(\ElkArte\EventManager $eventsManager)
self::$_attach_level = $modSettings['attachmentEnable'];

return array(
array('prepare_post', array('Attachments_Post_Module', 'prepare_post'), array()),
array('prepare_context', array('Attachments_Post_Module', 'prepare_context'), array('post_errors')),
array('finalize_post_form', array('Attachments_Post_Module', 'finalize_post_form'), array('show_additional_options', 'board', 'topic')),

array('prepare_save_post', array('Attachments_Post_Module', 'prepare_save_post'), array('post_errors')),
array('pre_save_post', array('Attachments_Post_Module', 'pre_save_post'), array('msgOptions')),
array('after_save_post', array('Attachments_Post_Module', 'after_save_post'), array('msgOptions')),
array('prepare_post', array('\\ElkArte\\Modules\\Attachments\\Post', 'prepare_post'), array()),
array('prepare_context', array('\\ElkArte\\Modules\\Attachments\\Post', 'prepare_context'), array('post_errors')),
array('finalize_post_form', array('\\ElkArte\\Modules\\Attachments\\Post', 'finalize_post_form'), array('show_additional_options', 'board', 'topic')),
array('prepare_save_post', array('\\ElkArte\\Modules\\Attachments\\Post', 'prepare_save_post'), array('post_errors')),
array('pre_save_post', array('\\ElkArte\\Modules\\Attachments\\Post', 'pre_save_post'), array('msgOptions')),
array('after_save_post', array('\\ElkArte\\Modules\\Attachments\\Post', 'after_save_post'), array('msgOptions')),
);
}
else
Expand Down Expand Up @@ -166,6 +165,7 @@ public function finalize_post_form(&$show_additional_options, $board, $topic)
if (strpos($attachID, 'post_tmp_' . $user_info['id'] . '_') !== false)
{
@unlink($attachment['tmp_name']);
@unlink($attachment['tmp_name'] . '_thumb');
}
}
$this->_attach_errors->addError('temp_attachments_gone');
Expand Down
2 changes: 1 addition & 1 deletion sources/ElkArte/Modules/Drafts/Profile.php
Expand Up @@ -32,7 +32,7 @@ public static function hooks(\ElkArte\EventManager $eventsManager)

if (!empty($modSettings['drafts_enabled']) && !empty($modSettings['drafts_post_enabled']))
{
add_integration_function('integrate_profile_areas', 'Drafts_Profile_Module::integrate_profile_areas', '', false);
add_integration_function('integrate_profile_areas', '\\ElkArte\\Modules\\Drafts\\Profile::integrate_profile_areas', '', false);
return array(
array('pre_load', array('\\ElkArte\\Modules\\Drafts\\Profile', 'pre_load'), array('post_errors')),
);
Expand Down
6 changes: 3 additions & 3 deletions sources/ElkArte/Modules/Poll/Display.php
Expand Up @@ -19,7 +19,7 @@
/**
* Class Poll_Display_Module
*/
class Poll_Display_Module extends \ElkArte\Modules\AbstractModule
class Display extends \ElkArte\Modules\AbstractModule
{
/**
* If polls are enabled
Expand All @@ -41,12 +41,12 @@ public static function hooks(\ElkArte\EventManager $eventsManager)
global $modSettings;

$return = array(
array('topicinfo', array('Poll_Display_Module', 'topicinfo'), array('topicinfo')),
array('topicinfo', array('\\ElkArte\\Modules\\Poll\\Display', 'topicinfo'), array('topicinfo')),
);
self::$_enabled = !empty($modSettings['pollMode']);
if (self::$_enabled && allowedTo('poll_view'))
{
$return[] = array('prepare_context', array('Poll_Display_Module', 'prepare_context'), array('template_layers'));
$return[] = array('prepare_context', array('\\ElkArte\\Modules\\Poll\\Display', 'prepare_context'), array('template_layers'));
}

return $return;
Expand Down
8 changes: 4 additions & 4 deletions sources/ElkArte/Modules/Poll/Post.php
Expand Up @@ -21,7 +21,7 @@
*
* This class contains all matter of things related to creating polls
*/
class Poll_Post_Module extends \ElkArte\Modules\AbstractModule
class Post extends \ElkArte\Modules\AbstractModule
{
protected static $_make_poll = false;

Expand All @@ -39,9 +39,9 @@ public static function hooks(\ElkArte\EventManager $eventsManager)
if (!empty($modSettings['pollMode']))
{
$return = array(
array('prepare_post', array('Poll_Post_Module', 'prepare_post'), array('topic', 'topic_attributes')),
array('prepare_context', array('Poll_Post_Module', 'prepare_context'), array('topic_attributes', 'topic', 'board')),
array('finalize_post_form', array('Poll_Post_Module', 'finalize_post_form'), array('destination', 'page_title', 'template_layers')),
array('prepare_post', array('\\ElkArte\\Modules\\Poll\\Post', 'prepare_post'), array('topic', 'topic_attributes')),
array('prepare_context', array('\\ElkArte\\Modules\\Poll\\Post', 'prepare_context'), array('topic_attributes', 'topic', 'board')),
array('finalize_post_form', array('\\ElkArte\\Modules\\Poll\\Post', 'finalize_post_form'), array('destination', 'page_title', 'template_layers')),
);
}

Expand Down
2 changes: 1 addition & 1 deletion themes/default/ManagePermissions.template.php
Expand Up @@ -243,7 +243,7 @@ function template_by_board()
echo '
<div class="content">
<ul class="perm_boards flow_hidden">
<li class="flow_hidden">
<li class="flow_hidden basic_row" style="font-weight: 600;">
<span class="perm_name floatleft">', $txt['board_name'], '</span>
<span class="perm_profile floatleft">', $txt['permission_profile'], '</span>
</li>';
Expand Down
2 changes: 1 addition & 1 deletion themes/default/Post.template.php
Expand Up @@ -660,7 +660,7 @@ function template_topic_replies_below()

/**
* The area below the postbox
* Typically holds our action buttons, save, preivew, drafts, etc
* Typically holds our action buttons, save, preview, drafts, etc
* Oh and lots of JS ;)
*/
function template_postarea_below()
Expand Down