powered by simpleCommunicator - 2.0.36     © 2025 Programmizd 02
Форумы / PHP, Perl, Python [игнор отключен] [закрыт для гостей] / Undefined property
1 сообщений из 1, страница 1 из 1
Undefined property
    #40092930
Петр
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Друзья помогите разобраться. Сам с 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
1 сообщений из 1, страница 1 из 1
Форумы / PHP, Perl, Python [игнор отключен] [закрыт для гостей] / Undefined property
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


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