Print

Detail- and original images are not displayed, why?

 

In the past, the problem has been reported that thumbnails are displayed but not detailed / original images. It looks like this, as shown in these screenshots, for example:

Detail view:

01-detailbilder-werden-nicht-angezeigt-en

PopUp box:

02-detailbilder-werden-nicht-angezeigt-popup-en

 

The reason for this is usually a conflict with a system plugin in Joomla!. That doesn't mean those with Joomla! supplied system plugins (core) are meant, but which are installed by a third-party extension.
To determine the problematic plugin, deactivate the third-party system plugins for testing purposes and check whether the detailed / original images are displayed then.

 

Technical background

In our opinion, these plugins don't pay attention to a certain characteristic of Joomla!, which can cause problems if a page uses search engine friendly URLs.

We would like to explain this context here and call on the developers of these plugins to check their code in this regard and adapt it if necessary.

To explain, we unfortunately have to go a little further: As most developers are probably aware, there are four system plugin events in Joomla, which are triggered in the following order: 'onAfterInitialise', 'onAfterRoute', 'onAfterDispatch' and 'onAfterRender'.

In the following, the events 'onAfterInitialise' and 'onAfterRoute' are particularly important as well as a core parameter of Joomla called 'format'. This parameter, which is usually passed in the URL, specifies which document type (see $document->getType()) should be rendered by Joomla. By default this is 'html', i.e. when a normal HTML page is to be loaded. This is why 'format' is usually not passed on for HTML pages (the default value 'html' is then used).
Other possible values are 'error', 'feed', 'pdf' and 'raw' (these correspond to the subfolder names of the directory 'libraries/src/Document'). For example, if you want to create and output a PDF file, you would have to explicitly specify 'format=pdf' in the URL so that Joomla automatically renders this document type.

The real problem can only occur if the search engine friendly URLs are activated in Joomla (it does not matter whether it is the Joomla core SEF or a SEF component). Since the 'format' parameter is no longer explicitly in the URL (but only implicitly in the SEF URL), Joomla can only "know" during the event 'onAfterRoute' at the earliest that 'format' is not the same as 'html' but something else: Only now the SEF URL is parsed and 'format' is explicitly available again.

This alone still does not cause the real problem. This only occurs when a system plugin is installed and activated that meets the following conditions:

If these conditions are met (which unfortunately is the case with many system plugins), 'JDocument' is loaded before the 'format' parameter is explicitly known to the system.

This sets the line

$instance->setType($ntype);

the function 'getInstance()' in the file 'libraries/src/Document/Document.php' already permanently sets the document type to 'html' (this will not be changed later)!

An extension that requests a different document type via the URL (the JoomGallery requires 'format=raw' when outputting an image, for example) can no longer work correctly with it.

Summary

Since these particular system plugins set the 'format' parameter to 'html' before it is certain that 'html' was even requested, we believe that these plugins are responsible for the problem.

Plugins that want to change the HTML output of a page should only do so when it is absolutely certain that an HTML page should be output at all. This is the case at the earliest for the 'onAfterRoute' event.

We hope that many developers read this text and try to rewrite the plugins that access 'JDocument' so that they only use the events 'onAfterRoute', 'onAfterDispatch' and 'onAfterRender'.