- Joined
- Mar 16, 2019
- Messages
- 50
- Points
- 38
Reputation:
Do either of you have a solution for this? "Template error: [E_WARNING] Undefined variable $baseUrl" if not this addon shouldn't be released for 2.2
@BattleKing @ENXF NET
@BattleKing @ENXF NET
BattleKing
Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
- Joined
- May 24, 2020
- Messages
- 3,529
- Points
- 523
Reputation:
- By BattleKing
Do either of you have a solution for this? "Template error: [E_WARNING] Undefined variable $baseUrl" if not this addon shouldn't be released for 2.2
@BattleKing @ENXF NET
↑View previous replies…
MEGAHERZ
just change that line
to
BattleKingfreakin lifesaver, man; btw I would pin this in the OP or main resource tab, as I'm not the only one with this issue.
BattleKingMaking this change eliminates the error but introduced another File heath check results problem..
validYou need to recreated the hash control file, but this is the normal behavior if you change one of them. It will be recognized by the system, which is good
BattleKingCould you please do the hash control file and re-upload it here? I hate to see that error.
validdone
BattleKing
Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
- Joined
- May 24, 2020
- Messages
- 3,529
- Points
- 523
Reputation:
- By BattleKing
think i may be a little slow as I'm not finding it in it
edit- oh you said baerUrl think u meant baseurl lolPHP:<?php namespace xenbros\Threadthumbnail\Entity; use XF\Mvc\Entity\Structure; class Thread extends XFCP_Thread { public function getfirstPostImgUrl() { //\XF::dump($this->Forum->Node); $ctustom_image_feild = $this->getCustomFields()[$this->Forum->Node->node_custom_image_feild]; if($ctustom_image_feild) { return $ctustom_image_feild; } $enable_first_image_url = \XF::options()->enable_first_image_url ; if($this->discussion_type != 'redirect'){ if ($enable_first_image_url) { $message = $this->FirstPost->message; preg_match('/\[IMG(.*?)\](.+?)\[\/IMG\]/i',$message,$matches); if($matches) { $url = $matches[2]; $linkInfo = \XF::app()->stringFormatter()->getLinkClassTarget($url); if ($linkInfo['local']) { return $url; } if(\XF::app()->options()->imageLinkProxy['images']) { $proxyUrl = \XF::app()->stringFormatter()->getProxiedUrlIfActive('image', $url); return $proxyUrl; } return $url; } } $attachments = $this->FirstPost->Attachments; foreach ($attachments as &$attachment) { //\XF::dump($this->Forum->Node->node_attachment_thumb); if ( $attachment->has_thumbnail == 'TRUE' ) { //\XF::dump($attachment->thumbnail_url); if ($this->Forum->Node->node_attachment_thumb == 'full') { $attachmentUrl = $baseUrl . \XF::app()->router()->buildLink('attachments', $attachment); } else{ $attachmentUrl = $attachment->thumbnail_url; } return $attachmentUrl; } } } if ($this->Forum->Node->node_default_thread_thumbnail_image) { return $this->Forum->Node->node_default_thread_thumbnail_image ; } else{ return \XF::options()->xb_th_default_image ; } } }
just change that line
PHP:
$attachmentUrl = $baseUrl . \XF::app()->router()->buildLink('attachments', $attachment);
PHP:
$attachmentUrl = \XF::app()->router()->buildLink('attachments', $attachment);
- Joined
- Mar 16, 2019
- Messages
- 50
- Points
- 38
Reputation:
- By MEGAHERZ
View attachment 31021
just change that line
toPHP:$attachmentUrl = $baseUrl . \XF::app()->router()->buildLink('attachments', $attachment);
PHP:$attachmentUrl = \XF::app()->router()->buildLink('attachments', $attachment);
- Joined
- Apr 3, 2020
- Messages
- 204
- Points
- 53
Reputation:
- By valid
View attachment 31021
just change that line
toPHP:$attachmentUrl = $baseUrl . \XF::app()->router()->buildLink('attachments', $attachment);
PHP:$attachmentUrl = \XF::app()->router()->buildLink('attachments', $attachment);
BattleKing
Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
- Joined
- May 24, 2020
- Messages
- 3,529
- Points
- 523
Reputation:
- By BattleKing
Making this change eliminates the error but introduced another File heath check results problem..
View attachment 38205
- Joined
- Apr 3, 2020
- Messages
- 204
- Points
- 53
Reputation:
- By valid
You need to recreated the hash control file, but this is the normal behavior if you change one of them. It will be recognized by the system, which is good
BattleKing
Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
- Joined
- May 24, 2020
- Messages
- 3,529
- Points
- 523
Reputation:
- By BattleKing
Could you please do the hash control file and re-upload it here? I hate to see that error.