Keyword

PHP Notice: Undefined property: K2ViewLatest::$user

  • Zurito
  • Zurito's Avatar Topic Author
  • Offline
  • New Member
More
4 years 2 months ago #177251 by Zurito
Hola, al mostrar los últimos artículos, recibo los siguientes mensajes en error.log:

PHP Notice: Undefined property: K2ViewLatest::$user in /....................../components/com_k2/templates/default/latest_item.php on line 125
PHP Notice: Trying to get property 'guest' of non-object in /....................../components/com_k2/templates/default/latest_item.php on line 125

La línea 125 del fichero latest_item.php (última versión de K2), contiene:

<?php if($this->item->params->get('latestItemCommentsAnchor') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>

Alguna solución?

Gracias

Please Log in or Create an account to join the conversation.

More
4 years 2 months ago #177255 by JoomlaWorks
Replied by JoomlaWorks on topic PHP Notice: Undefined property: K2ViewLatest::$user
Which K2 version are you using?

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Zurito
  • Zurito's Avatar Topic Author
  • Offline
  • New Member
More
4 years 2 months ago #177260 by Zurito
K2 v2.10.3, plantilla JA Edenite II y PHP 7.4.

El fichero latest_item.php es idéntico al de k2-master y ocurre lo mismo con el de éste.

Gracias.

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #177282 by JoomlaWorks
Replied by JoomlaWorks on topic PHP Notice: Undefined property: K2ViewLatest::$user
Delete and re-create the menu item that you used with that K2 view. Is it resolved?

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Zurito
  • Zurito's Avatar Topic Author
  • Offline
  • New Member
More
4 years 1 month ago - 4 years 1 month ago #177304 by Zurito
Solucionado, muchas gracias.

Creo que mis problemas vienen al tratarse de actualización desde antigua versión de K2 a la última, en sitio Joomla 2.5 con foro PHPBB y JFusion, actualizado a Joomla 3.9.22 con foro PHPBB última versión e independiente, pasando de PHP 5.6 a 7.4.11.

Regenerados los menús K2, desapareció el error anterior, pero aparece otro nuevo:
PHP Notice: Trying to get property 'alias' of non-object in /..../.../.../components/com_k2/router.php on line 283

$segments[0] == getCategoryProps($segments[0])->alias &&

Por lo que creo que tendré que regenerar más apartados.

Edit: problema con error router.php on line 283 solucionado con:

Fotis wrote: Replace /components/com_k2/router.php with the one from: jmp.sh/CZ2oMKG


Muchas gracias por todo.
Last edit: 4 years 1 month ago by Zurito.

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #177314 by JoomlaWorks
Replied by JoomlaWorks on topic PHP Notice: Undefined property: K2ViewLatest::$user
Ah, yes, the menus. These can be a PITA after migrating to J3.x.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum