Přihlásit se

Joomla 5.1.0 a Joomla 4.4.4 (17 dub 2024)

Dnes byla uvolněna nová verze Joomla 5.1.0, společně s Joomla 4.4.4. Tato verze přináší spoustu nových funkcí, vylepšení v oblasti bezpečnosti a kódu a díky těmto vylepšením i vyšší rychlost.

Problém so šablónou At Cesmiro

18. lis 2018 12:18 #137776
Problém so šablónou At Cesmiro od Mat
Návštěvník
Ahojte, prešiel som na joomlu 3.9.0 so šablonou At Cesmiro: www.joomla24.com/remository/Download/Tem...ates/At_Cesmiro.html

Stránku mám na localhoste vo verzií PHP 5.6.31 mi to zobrazuje chyby:
Notice: Undefined property: stdClass::$contactid in...
Deprecated: Non-static method Joomla\CMS\Application\SiteApplication::getMenu() should not be called statically, assuming $this from incompatible context in....
Deprecated: Non-static method Joomla\CMS\Application\CMSApplication::getMenu() should not be called statically, assuming $this from incompatible context in....
Pod tými chybami mi zobrazí článok

Problém ale pokračuje keď chcem dať vyššiu verziu PHP, keď dám PHP 7.1.9, po kliknutí na konkrétny článok mi zobrazí iba chybu:
0 - Using $this when not in object context
zobrazí mi iba chybu - žiaden text článkov...

Prosím poraďte čo robiť, viem že ta šablona bude asi zastaralá, ako sa zbaviť tých chýb???

18. lis 2018 12:58 #137778
Odpověď od Cony
Moderátor

Mat napsal: Prosím poraďte čo robiť, viem že ta šablona bude asi zastaralá, ako sa zbaviť tých chýb???

Ano šablona bude zřejmě staršího data. Máte dvě možnosti, buď zůstat na starším PHP, a v globalní nastavení Joomly nastavit Hlášení chyb na Žádné, nebo opravit kódy v šabloně. V tomto případě zřejmě někde v šabloně bude volání
Code:
JApplication::getMenu
což by mělo nově být
Code:
JFactory::getApplication()->getMenu()
Ale dost možná tam toho bue víc.

18. lis 2018 16:16 #137782
Odpověď od Ernst
Joomla Expert
ano, je to tak, jak psal Cony.
Pokud se vám ta hláška objeví při zobrazení článku, tak si zkuste najít /templates/xxxxxxx/html/com_content/article/default.php
Prostřednictvím FTP, když to neumíte, můžete použít rozšíření pro Joomla Phoca Commander, si v tomto souboru změňte kód, tak jak psal cony -

JApplication::getMenu
což by mělo nově být
JFactory::getApplication()->getMenu()


Druhou možností je, že si ten soubor přejmenujete a tak použijete tento soubor z joomly, ne ze šablony (pak se vám ale také začne jinak zobrazovat) a musel by jste měnit styly a možná i některé funkce, proto doporučuji jen tu změnu kódu.

18. lis 2018 23:49 #137793
Odpověď od Mat
Návštěvník
Našiel som default.php, ale konkrétne veci nie. Toto je to čo som tam našiel, čo môžem v tom zmeniť, prípadne vymazať aby to fungovalo?
Code:
<?php defined('_JEXEC') or die; require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../../../functions.php'); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); $component = new ArtxContent($this, $this->params); $article = $component->article('article', $this->item, $this->item->params, array('print' => $this->print)); echo $component->beginPageContainer('item-page'); if (strlen($article->pageHeading)) echo $component->pageHeading($article->pageHeading); $params = $article->getArticleViewParameters(); if (strlen($article->title)) { $params['header-text'] = $this->escape($article->title); if (strlen($article->titleLink)) $params['header-link'] = $article->titleLink; } // Change the order of "if" statements to change the order of article metadata header items. if (strlen($article->created)) $params['metadata-header-icons'][] = "<span class=\"at-postdateicon\">" . $article->createdDateInfo($article->created) . "</span>"; if (strlen($article->modified)) $params['metadata-header-icons'][] = "<span class=\"at-postdateicon\">" . $article->modifiedDateInfo($article->modified) . "</span>"; if (strlen($article->published)) $params['metadata-header-icons'][] = "<span class=\"at-postdateicon\">" . $article->publishedDateInfo($article->published) . "</span>"; if (strlen($article->author)) $params['metadata-header-icons'][] = "<span class=\"at-postauthoricon\">" . $article->authorInfo($article->author, $article->authorLink) . "</span>"; if ($article->printIconVisible) $params['metadata-header-icons'][] = $article->printIcon(); if ($article->emailIconVisible) $params['metadata-header-icons'][] = $article->emailIcon(); if ($article->editIconVisible) $params['metadata-header-icons'][] = $article->editIcon(); if (strlen($article->hits)) $params['metadata-header-icons'][] = $article->hitsInfo($article->hits); // Build article content $content = ''; if (!$article->introVisible) $content .= $article->event('afterDisplayTitle'); $content .= $article->event('beforeDisplayContent'); if (strlen($article->toc)) $content .= $article->toc($article->toc); if (strlen($article->text)) $content .= $article->text($article->text); if ($article->introVisible) $content .= $article->intro($article->intro); if (strlen($article->readmore)) $content .= $article->readmore($article->readmore, $article->readmoreLink); $content .= $article->event('afterDisplayContent'); $params['content'] = $content; // Change the order of "if" statements to change the order of article metadata footer items. if (strlen($article->category)) $params['metadata-footer-icons'][] = "<span class=\"at-postcategoryicon\">" . $article->categories($article->parentCategory, $article->parentCategoryLink, $article->category, $article->categoryLink) . "</span>"; // Render article echo $article->article($params); echo $component->endPageContainer();

19. lis 2018 00:13 #137794
Odpověď od Cony
Moderátor
Tady zřejmě nic. Šablona používá jakýsi svůj vlastní framework, nepoužívá standardy Joomly, vstupní bod bude v souboru functions.php v hlavním adresáři šablony, ale těch souborů tam bude zřejmě někde víc. kuste porhledat celý adresář na ::getMenu.

Otázkou ale je kolik podobných anachronismů tam bude, jestli by se časově a náročností spíš nevyplatilo přejít na jinou, novou šablonu.

19. lis 2018 00:18 #137796
Odpověď od Ernst
Joomla Expert
jen pro jistotu - kde je ten default.php umístěn?

Powered by Fórum