From 63053757c94caf15a01d9692813bd0ea0c19806f Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Fri, 10 Oct 2025 20:03:46 +0200 Subject: [PATCH] Guides/Fixup * fix showing wrong guide version to staff * fix sticky icon offset --- endpoints/guide/guide.php | 12 ++++++------ .../components/response/templateresponse.class.php | 2 +- static/css/global.css | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/endpoints/guide/guide.php b/endpoints/guide/guide.php index 9bf5836a..215bdb53 100644 --- a/endpoints/guide/guide.php +++ b/endpoints/guide/guide.php @@ -68,12 +68,12 @@ class GuideBaseResponse extends TemplateResponse implements ICache $this->contribute = CONTRIBUTE_NONE; } - if ($this->articleUrl) + // owner or staff and manual rev passed + if ($this->subject->userCanView() && $this->_get['rev']) + $this->guideRevision = $this->_get['rev']; + // has publicly viewable version + else if ($this->subject->canBeViewed()) $this->guideRevision = $this->subject->getField('rev'); - else if ($this->subject->userCanView()) - $this->guideRevision = $this->_get['rev'] ?? $this->subject->getField('latest'); - else - $this->subject->getField('rev'); $this->h1 = $this->subject->getField('name'); @@ -127,7 +127,7 @@ class GuideBaseResponse extends TemplateResponse implements ICache $this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"], __forceTabs: true); - // the article text itself is added by PageTemplate::addArticle() + // the article text itself is added by TemplateResponse::addArticle() parent::generate(); $this->result->registerDisplayHook('infobox', [self::class, 'infoboxHook']); diff --git a/includes/components/response/templateresponse.class.php b/includes/components/response/templateresponse.class.php index 7ceffdcf..4b165c82 100644 --- a/includes/components/response/templateresponse.class.php +++ b/includes/components/response/templateresponse.class.php @@ -418,7 +418,7 @@ class TemplateResponse extends BaseResponse if (isset($this->guideRevision)) $article = DB::Aowow()->selectRow('SELECT `article`, `locale`, `editAccess` FROM ?_articles WHERE `type` = ?d AND `typeId` = ?d AND `rev` = ?d', Type::GUIDE, $this->typeId, $this->guideRevision); - if (!$article && $this->gPageInfo['articleUrl']) + if (!$article && !empty($this->gPageInfo['articleUrl'])) $article = DB::Aowow()->selectRow('SELECT `article`, `locale`, `editAccess` FROM ?_articles WHERE `url` = ? AND `locale` IN (?a) ORDER BY `locale` DESC, `rev` DESC LIMIT 1', $this->gPageInfo['articleUrl'], [Lang::getLocale()->value, Locale::EN->value]); if (!$article && !empty($this->type) && isset($this->typeId)) diff --git a/static/css/global.css b/static/css/global.css index b80fe0f7..231c7068 100644 --- a/static/css/global.css +++ b/static/css/global.css @@ -422,10 +422,12 @@ padding-left: 21px; } +/* aowow - clips in the list marker .infobox .guide-sticky { position: relative; left: -6px; } +*/ #guiderating { display: block;