From 7dc283f64945513422739f30b0761ea3b8fcd511 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sat, 26 May 2018 11:00:22 +0200 Subject: [PATCH] Misc/Fixups * squash multiple notices from error log * fixed copy&paste error preventing view on custom profiles * fixed display of spell requirements if mount was required after changs to mount sorting * properly get/send error code in profile synchronisation * use clear:left after floating mail block in template --- includes/profiler.class.php | 4 ++-- includes/types/profile.class.php | 2 +- localization/lang.class.php | 2 +- pages/achievement.php | 18 ++++++++++-------- pages/quest.php | 10 +++++----- pages/spell.php | 2 +- pages/user.php | 8 ++++++++ template/pages/achievement.tpl.php | 1 + template/pages/quest.tpl.php | 1 + 9 files changed, 30 insertions(+), 18 deletions(-) diff --git a/includes/profiler.class.php b/includes/profiler.class.php index 8d0798f5..b9dd1393 100644 --- a/includes/profiler.class.php +++ b/includes/profiler.class.php @@ -256,14 +256,14 @@ class Profiler // error out all profiles with status WORKING, that are older than 60sec DB::Aowow()->query('UPDATE ?_profiler_sync SET status = ?d, errorCode = ?d WHERE status = ?d AND requestTime < ?d', PR_QUEUE_STATUS_ERROR, PR_QUEUE_ERROR_UNK, PR_QUEUE_STATUS_WORKING, time() - MINUTE); - $subjectStatus = DB::Aowow()->select('SELECT typeId AS ARRAY_KEY, status, realm FROM ?_profiler_sync WHERE `type` = ?d AND typeId IN (?a)', $type, $subjectGUIDs); + $subjectStatus = DB::Aowow()->select('SELECT typeId AS ARRAY_KEY, status, realm, errorCode FROM ?_profiler_sync WHERE `type` = ?d AND typeId IN (?a)', $type, $subjectGUIDs); $queue = DB::Aowow()->selectCol('SELECT CONCAT(type, ":", typeId) FROM ?_profiler_sync WHERE status = ?d AND requestTime < UNIX_TIMESTAMP() ORDER BY requestTime ASC', PR_QUEUE_STATUS_WAITING); foreach ($subjectGUIDs as $guid) { if (empty($subjectStatus[$guid])) // whelp, thats some error.. $response[] = [PR_QUEUE_STATUS_ERROR, 0, 0, PR_QUEUE_ERROR_UNK]; else if ($subjectStatus[$guid]['status'] == PR_QUEUE_STATUS_ERROR) - $response[] = [PR_QUEUE_STATUS_ERROR, 0, 0, $subjectStatus[$guid]['errCode']]; + $response[] = [PR_QUEUE_STATUS_ERROR, 0, 0, $subjectStatus[$guid]['errorCode']]; else $response[] = array( $subjectStatus[$guid]['status'], diff --git a/includes/types/profile.class.php b/includes/types/profile.class.php index 1d4160d4..06be3ff8 100644 --- a/includes/types/profile.class.php +++ b/includes/types/profile.class.php @@ -167,7 +167,7 @@ class ProfileList extends BaseType if (!$this->isCustom() || User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU)) return true; - if ($this->subject->getField('cuFlags') & PROFILER_CU_DELETED) + if ($this->getField('cuFlags') & PROFILER_CU_DELETED) return false; if (User::$id == $this->getField('user')) diff --git a/localization/lang.class.php b/localization/lang.class.php index ff151f98..346d495e 100644 --- a/localization/lang.class.php +++ b/localization/lang.class.php @@ -252,7 +252,7 @@ class Lang } if ($class == ITEM_CLASS_MISC) // yeah hardcoded.. sue me! - return self::spell('cat', -5); + return self::spell('cat', -5, 0); $tmp = []; $strs = self::spell($class == ITEM_CLASS_ARMOR ? 'armorSubClass' : 'weaponSubClass'); diff --git a/pages/achievement.php b/pages/achievement.php index b04a2f9c..81219b6e 100644 --- a/pages/achievement.php +++ b/pages/achievement.php @@ -567,20 +567,22 @@ class AchievementPage extends GenericPage $reqCss = true; $mail = array( - 'delay' => null, - 'sender' => null, - 'subject' => Util::parseHtmlText(Util::localizedString($letter, 'subject', true)), - 'text' => Util::parseHtmlText(Util::localizedString($letter, 'text', true)) + 'delay' => null, + 'sender' => null, + 'attachments' => [], + 'subject' => Util::parseHtmlText(Util::localizedString($letter, 'subject', true)), + 'text' => Util::parseHtmlText(Util::localizedString($letter, 'text', true)) ); } else if ($_ = Util::parseHtmlText($this->subject->getField('text', true, true))) { $reqCss = true; $mail = array( - 'delay' => null, - 'sender' => null, - 'subject' => Util::parseHtmlText($this->subject->getField('subject', true, true)), - 'text' => $_ + 'delay' => null, + 'sender' => null, + 'attachments' => [], + 'subject' => Util::parseHtmlText($this->subject->getField('subject', true, true)), + 'text' => $_ ); } diff --git a/pages/quest.php b/pages/quest.php index 6ae5bb1e..f8b080f4 100644 --- a/pages/quest.php +++ b/pages/quest.php @@ -1217,10 +1217,11 @@ class QuestPage extends GenericPage $letter = DB::Aowow()->selectRow('SELECT * FROM ?_mailtemplate WHERE id = ?d', $rmtId); $mail = array( - 'delay' => $delay ? sprintf(Lang::quest('mailIn'), Util::formatTime($delay * 1000)) : null, - 'sender' => null, - 'text' => $letter ? Util::parseHtmlText(Util::localizedString($letter, 'text')) : null, - 'subject' => Util::parseHtmlText(Util::localizedString($letter, 'subject')) + 'delay' => $delay ? sprintf(Lang::quest('mailIn'), Util::formatTime($delay * 1000)) : null, + 'sender' => null, + 'attachments' => [], + 'text' => $letter ? Util::parseHtmlText(Util::localizedString($letter, 'text')) : null, + 'subject' => Util::parseHtmlText(Util::localizedString($letter, 'subject')) ); foreach ($startEnd as $se) @@ -1239,7 +1240,6 @@ class QuestPage extends GenericPage $mailLoot = new Loot(); if ($mailLoot->getByContainer(LOOT_MAIL, $rmtId)) { - $mail['attachments'] = []; $this->extendGlobalData($mailLoot->jsGlobals); foreach ($mailLoot->getResult() as $loot) { diff --git a/pages/spell.php b/pages/spell.php index 6d7f0b8d..8ce326a3 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -2062,7 +2062,7 @@ class SpellPage extends GenericPage } else if ($effAura > 0) - $foo['name'] .= Lang::main('colon').'Unknown Aura ('.$effAura.')'; + $foo['name'] .= 'Unknown Aura ('.$effAura.')'; break; } diff --git a/pages/user.php b/pages/user.php index 2bdfab9a..8acb27e1 100644 --- a/pages/user.php +++ b/pages/user.php @@ -13,6 +13,7 @@ class UserPage extends GenericPage protected $typeId = 0; protected $pageName = ''; + protected $user = []; public function __construct($pageCall, $pageParam) { @@ -37,6 +38,10 @@ class UserPage extends GenericPage protected function generateContent() { + if (!$this->user) // shouldn't happen .. but did + return; + + /***********/ /* Infobox */ /***********/ @@ -245,6 +250,9 @@ class UserPage extends GenericPage protected function generateTitle() { + if (!$this->user) // shouldn't happen .. but did + return; + array_unshift($this->title, sprintf(Lang::user('profileTitle'), $this->user['displayName'])); } diff --git a/template/pages/achievement.tpl.php b/template/pages/achievement.tpl.php index 5d8bfe1d..2cccba1a 100644 --- a/template/pages/achievement.tpl.php +++ b/template/pages/achievement.tpl.php @@ -107,6 +107,7 @@ endif; $this->brick('mail'); if (!empty($this->transfer)): + echo "
"; echo "
\n ".$this->transfer."\n"; endif; diff --git a/template/pages/quest.tpl.php b/template/pages/quest.tpl.php index d2ac0761..3bb9a83e 100644 --- a/template/pages/quest.tpl.php +++ b/template/pages/quest.tpl.php @@ -203,6 +203,7 @@ endif; $this->brick('mail', ['offset' => ++$offset]); if (!empty($this->transfer)): + echo "
"; echo "
\n ".$this->transfer."\n"; endif;