Take the article component and add the following log code to the end of the content.php file.
$string = time() . PHP_EOL;
$resource = fopen(DIR.DIRECTORY_SEPARATOR."test.log", "a");
fwrite($resource, $string);
fclose($resource);
Create an article and assign a menu item to it
Create a module and assign it to the same menu item
View the article you created, you will notice that the timestamp is created twice.
Un-publish the module and it will be triggered once.
There should only be one timestamp log per view of the article.
Timestamp logs are produced twice on each view of the article
While the content is not reproduced. If you were pulling from an API, that provided something large like images. You dont want to be running the same query twice.
Labels |
Added:
?
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-01-26 20:50:37 |
Closed_By | ⇒ | codeChap |
Oops
Status | Closed | ⇒ | New |
Closed_Date | 2017-01-26 20:50:37 | ⇒ | |
Closed_By | codeChap | ⇒ |
I cannot reproduce the issue as described with Joomla 3.7.0. Which module type did you use? Any special settings in article, menu item, module?
It did not matter what module was used, I'll test against 3.7 and get back to you.
Sent from my iPhone
On 27 Jan 2017, at 14:54, bertmert notifications@github.com wrote:
I cannot reproduce the issue as described with Joomla 3.7.0. Which module type did you use? Any special settings in article, menu item, module?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
Can't reproduce it either on staging.
Maybe check if there is a redirect happening for some reason, then that would explain the double loading.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-01-28 13:09:59 |
Closed_By | ⇒ | codeChap |
I can't reproduce this on a fresh installation of 3.7, I can when I install the template used. So not a Joomla issue. Thanks for looking guys. Sorry for any time waisted.
In the template when you use the countModules or getModules i.e.:
JModuleHelper::getModules('left')
or
$this->countModules('left');
The component is triggered twice.
Status | Closed | ⇒ | New |
Closed_Date | 2017-01-28 13:09:59 | ⇒ | |
Closed_By | codeChap | ⇒ |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-02-01 21:54:12 |
Closed_By | ⇒ | codeChap |