Гость
Форумы / PHP, Perl, Python [игнор отключен] [закрыт для гостей] / Undefined property / 1 сообщений из 1, страница 1 из 1
24.08.2021, 15:25
    #40092930
Петр
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Undefined property
Друзья помогите разобраться. Сам с PHP не работал (PHP 7.0.32, Joomla 3.9.13 ). Получаю ошибку:

Undefined property: stdClass::$text in /var/www/***/plugins/system/nnframework/helpers/search.php on line 187

строка 187 это:
Код: php
1.
if ($item->text != '')


полный код функции:
Код: php
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
public function getData()
	{
		// Lets load the content if it doesn't already exist
		if (empty($this->_data))
		{
			$areas = $this->getAreas();

			JPluginHelper::importPlugin('search');
			$dispatcher = JEventDispatcher::getInstance();
			$results = $dispatcher->trigger('onContentSearch', array(
				$this->getState('keyword'),
				$this->getState('match'),
				$this->getState('ordering'),
				$areas['active'])
			);

			$rows = array();

			foreach ($results as $result)
			{
				$rows = array_merge((array) $rows, (array) $result);
			}

			$this->_total	= count($rows);

			if ($this->getState('limit') > 0)
			{
				$this->_data = array_splice($rows, $this->getState('limitstart'), $this->getState('limit'));
			}
			else
			{
				$this->_data = $rows;
			}

			/* >>> ADDED: Run content plugins over results */
			$params = JFactory::getApplication()->getParams('com_content');
			$params->set('nn_search', 1);
			foreach ($this->_data as $item)
			{
				if ($item->text != '')
				{
					$dispatcher->trigger('onContentPrepare', array('com_content.article', &$item, &$params, 0));
					// strip html tags from title
					$item->title = strip_tags($item->title);
				}
			}
			/* <<< */
		}

		return $this->_data;
	}
...
Рейтинг: 0 / 0
Форумы / PHP, Perl, Python [игнор отключен] [закрыт для гостей] / Undefined property / 1 сообщений из 1, страница 1 из 1
Целевая тема:
Создать новую тему:
Автор:
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]