J3 Issue ?
avatar jjnxpct
jjnxpct
16 Apr 2019

Steps to reproduce the issue

Cronjob triggers Smart Search plugin to index the content:
/usr/local/bin/php /home/[USER]/domains/[DOMAIN]/public_html/cli/finder_indexer.php --purge

Expected result

All batches processed without any errors

Actual result

We see these warnings (in the cron e-mail we receive):

Warning: Use of undefined constant JPATH_COMPONENT - assumed 'JPATH_COMPONENT' (this will throw an Error in a future version of PHP) in /home/[USER]/domains/[DOMAIN]/public_html/administrator/components/com_fields/models/group.php on line 74

System information (as much as possible)

Joomla! 3.9.5
MariaDB 5.5.63
PHP 7.2.16
Apache/2

avatar jjnxpct jjnxpct - open - 16 Apr 2019
avatar joomla-cms-bot joomla-cms-bot - change - 16 Apr 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Apr 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 16 Apr 2019
avatar jjnxpct jjnxpct - change - 16 Apr 2019
The description was changed
avatar jjnxpct jjnxpct - edited - 16 Apr 2019
avatar jjnxpct jjnxpct - change - 16 Apr 2019
The description was changed
avatar jjnxpct jjnxpct - edited - 16 Apr 2019
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 17 Apr 2019

@HLeithner can you please comment?

avatar franz-wohlkoenig franz-wohlkoenig - change - 17 Apr 2019
Status New Information Required
avatar HLeithner
HLeithner - comment - 17 Apr 2019

@Hackwar can you look at this?

avatar Hackwar
Hackwar - comment - 17 Apr 2019

This is unrelated to smart search and rather an issue in the fields group model.

avatar HLeithner
HLeithner - comment - 17 Apr 2019

I think that the CLI doesn't provide a component context so JPATH_COMPONENT isn't set while indexing.

But yes the problem seams to be in com_fields that tries to find out which component is active using this constant.

@laoneo Can we remove this check because we only add a table search path here.

avatar ReLater
ReLater - comment - 17 Apr 2019

Why not adding an additional
define('JPATH_COMPONENT', JPATH_COMPONENT_ADMINISTRATOR);
inside cli script.

I think that the CLI doesn't provide a component context

But finder_indexer.php does:
define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/com_finder');

avatar Quy Quy - change - 17 Apr 2019
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2019-04-17 17:25:02
Closed_By Quy
avatar joomla-cms-bot joomla-cms-bot - change - 17 Apr 2019
Closed_By Quy joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 17 Apr 2019
avatar Quy
Quy - comment - 17 Apr 2019

Please test PR #24630.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24607.

avatar joomla-cms-bot
joomla-cms-bot - comment - 17 Apr 2019

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/24607

Add a Comment

Login with GitHub to post a comment