HTTP 500 status code during Smart Search...

Search
Other Bug Reports questions
Forum

HTTP 500 status code during Smart Search indexing due to sourcerer

Thomas Karl's Avatar Thomas Karl
Hi Peter,

I am using one of your great extensions and hit upon a problem during the recent Joomla!4.4.7/8 update, that you may want learn about.

Configuration
- Joomla!4.4.7/8 (both are affected)
- Sourcerer 10.1.3
- Bilingual website (1st language German, 2nd language English)
- The website has for each language 3 articles that include sourcerer code in order to create custom forms

Example of Sourcerer Code in German article (ID = 123)
<p>{source}&lt;?php include JPATH_SITE.'/sourcerer/demo_de.php'; ?&gt;{/source}</p>

Example of Sourcerer Code in English article (ID = 124)
<p>{source}&lt;?php include JPATH_SITE.'/sourcerer/demo_en.php'; ?&gt;{/source}</p>

Problem
When Indexing of Smart Search is started, the process is terminated prematurely with the red error message:

Smart Search Indexer
The following message was returned by the server:
An error has occurred while fetching the JSON data: HTTP 500 status code.

Inspection of the indexed article shows,
- that the last successfully indexed article is the one with ID=123 (German article)
- that indexing is overall successful, if the sourcerer code is completely removed from all English articles (as 2nd language the IDs of the English articles are always larger than the IDs of the German articles).

I did not recognize this problem earlier, because up to J!4.4.7 I was still running the old search rather than the "new" Smart Search.

I do not know, but maybe the issue is caused or facilitated by sourcerer. So, at least I want to report it to give you the chance to have a look.

Kind Regards from Germany
Tom
Peter van Westen's Avatar Peter van Westen ADMIN
This seams to point to an issue with the php code in the php files you are including. So in your own custom php code.
Please post a rating at the Joomla! Extensions Directory
Thomas Karl's Avatar Thomas Karl
Thanks for nudging me in the right direction, Peter.

It seems the problem was caused by redundant custom functions in my php code (same function defined in different php files used in different custom forms). After introduction of namespaces the problem is gone and the indexing of Smart Search succeeds without any error.

Another lesson learned about php 🙂

Regards
Tom
You can only post on this forum if you log in