How to reduce FC Universal Module Duplicate Database Queries?

More
5 years 2 months ago - 5 years 2 months ago #75670 by iamrobert
Hi,

I have many duplicate db queries.

I am creating a banner and load it with FLEXIcontent Universal Content Module.



Disabled it - I get 10 duplicate queries:



If enabled its creates 65 duplicate queries:



Examples include:
Code:
Duplicate queries: #91 #107 #121 SELECT t.tid, t.itemid FROM zzz_flexicontent_tags_item_relations AS t WHERE t.itemid IN (591) Duplicate queries: #92 #108 #122 SELECT c.catid, c.itemid FROM zzz_flexicontent_cats_item_relations AS c WHERE c.itemid IN (591) SELECT DISTINCT c.id, c.title, CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(':', c.id, c.alias) ELSE c.id END as slug FROM zzz_categories AS c JOIN zzz_flexicontent_cats_item_relations AS rel ON rel.catid = c.id WHERE rel.itemid IN (591) Duplicate queries: #94 #110 #124 SELECT DISTINCT itemid, 1 AS favs FROM zzz_flexicontent_favourites WHERE type = 0 AND itemid IN ('591') Duplicate queries: #95 #111 #125 SELECT DISTINCT itemid, 1 AS fav FROM zzz_flexicontent_favourites WHERE type = 0 AND itemid IN (591) AND userid = 0 Duplicate queries: #96 #112 #126 SELECT i.id, u.name, i.created_by_alias as alias, u.username, u.email FROM zzz_content AS i LEFT JOIN zzz_users AS u ON u.id = i.created_by WHERE i.id IN ('591') Duplicate queries: #97 #113 #127 SELECT i.id, u.name, u.username, u.email FROM zzz_content AS i LEFT JOIN zzz_users AS u ON u.id = i.modified_by WHERE i.id IN ('591') Duplicate queries: #100 #116 #130 SELECT *, field_id as extra_id FROM zzz_flexicontent_items_extravote WHERE content_id IN ('591') Duplicate queries: #101 #117 #131 SELECT field_id, value, item_id, valueorder, suborder FROM zzz_flexicontent_fields_item_relations WHERE item_id IN (591) AND value > "" ORDER BY item_id, field_id, valueorder, suborder SELECT field_id, value, item_id, valueorder, suborder FROM zzzz_flexicontent_fields_item_relations WHERE item_id IN (591) AND value > "" ORDER BY item_id, field_id, valueorder, suborder

Is this expected behavior? IS there a workaround?
Last edit: 5 years 2 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago #75672 by ggppdk
Hello

it seems like the same module is loaded 3 times
aka this duplicate queries are not by the module itself


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago - 5 years 2 months ago #75674 by iamrobert
Thanks for your feedback.

I have made a reduced test case - so am using the standard news universal content template, and default flexi template and protostar theme.

If put it in a module position eg banner - then it has few duplicates:



However, if I put it as {module 138} in the description it triggers the duplicates:



Now - I am trying to think of the reason why?

Could it be linked to advanced module manager?
Last edit: 5 years 2 months ago by iamrobert.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago - 5 years 2 months ago #75675 by iamrobert
I have discovered the issue I believe.




If I use modules anywhere ( www.regularlabs.com/extensions/modulesanywhere ) - I get all the duplicates.

MODULES ANYWHERE enabled
CODE: {module 102}






MODULES ANYWHERE disabled
CODE: {loadmodule mod_flexicontent,about}





So - that's a big difference!
Last edit: 5 years 2 months ago by iamrobert.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago #75676 by ggppdk
Hello

if you have a testing copy of the website

edit
/modules/mod_flexicontent/mod_flexicontent.php

Find
Code:
if ( !$show_mod ) return;

and after the above add
Code:
echo '<code>MODULE TITLE: ' . $module->title . ' </code>'; echo "<pre>"; debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); echo "</pre>";


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago - 5 years 2 months ago #75677 by iamrobert
Thanks - here's what I discovered:


MODULE TITLE: about
#0 include() called at [D:\z2018\UniServerZ\www\cancer\libraries\src\Helper\ModuleHelper.php:200]
#1 Joomla\CMS\Helper\ModuleHelper::renderModule() called at [D:\z2018\UniServerZ\www\cancer\libraries\src\Document\Renderer\Html\ModuleRenderer.php:98]
#2 Joomla\CMS\Document\Renderer\Html\ModuleRenderer->render() called at [D:\z2018\UniServerZ\www\cancer\plugins\system\modulesanywhere\src\Replace.php:593]
#3 RegularLabs\Plugin\System\ModulesAnywhere\Replace::processModule() called at [D:\z2018\UniServerZ\www\cancer\plugins\system\modulesanywhere\src\Replace.php:333]
#4 RegularLabs\Plugin\System\ModulesAnywhere\Replace::processMatch() called at [D:\z2018\UniServerZ\www\cancer\plugins\system\modulesanywhere\src\Replace.php:220]
#5 RegularLabs\Plugin\System\ModulesAnywhere\Replace::replaceMatches() called at [D:\z2018\UniServerZ\www\cancer\plugins\system\modulesanywhere\src\Replace.php:202]
#6 RegularLabs\Plugin\System\ModulesAnywhere\Replace::replace() called at [D:\z2018\UniServerZ\www\cancer\plugins\system\modulesanywhere\src\Replace.php:157]
#7 RegularLabs\Plugin\System\ModulesAnywhere\Replace::processModules() called at [D:\z2018\UniServerZ\www\cancer\plugins\system\modulesanywhere\src\Helper.php:81]
#8 RegularLabs\Plugin\System\ModulesAnywhere\Helper->processModules()
#9 call_user_func_array() called at [D:\z2018\UniServerZ\www\cancer\libraries\regularlabs\src\Article.php:226]
#10 RegularLabs\Library\Article::processText() called at [D:\z2018\UniServerZ\www\cancer\libraries\regularlabs\src\Article.php:209]
#11 RegularLabs\Library\Article::process() called at [D:\z2018\UniServerZ\www\cancer\plugins\system\modulesanywhere\src\Helper.php:31]
#12 RegularLabs\Plugin\System\ModulesAnywhere\Helper->onContentPrepare()
#13 call_user_func_array() called at [D:\z2018\UniServerZ\www\cancer\plugins\system\modulesanywhere\src\Plugin.php:97]
#14 RegularLabs\Plugin\System\ModulesAnywhere\Plugin->run() called at [D:\z2018\UniServerZ\www\cancer\plugins\system\modulesanywhere\modulesanywhere.php:49]
#15 PlgSystemModulesAnywhere->onContentPrepare() called at [D:\z2018\UniServerZ\www\cancer\libraries\joomla\event\event.php:70]
#16 JEvent->update() called at [D:\z2018\UniServerZ\www\cancer\components\com_flexicontent\helpers\dispatcher.php:172]
#17 FCDispatcher->trigger() called at [D:\z2018\UniServerZ\www\cancer\components\com_flexicontent\classes\flexicontent.fields.php:1060]
#18 FlexicontentFields::triggerContentPlugins() called at [D:\z2018\UniServerZ\www\cancer\components\com_flexicontent\classes\flexicontent.fields.php:885]
#19 FlexicontentFields::renderField() called at [D:\z2018\UniServerZ\www\cancer\components\com_flexicontent\classes\flexicontent.fields.php:1166]
#20 FlexicontentFields::renderPositions() called at [D:\z2018\UniServerZ\www\cancer\components\com_flexicontent\classes\flexicontent.fields.php:164]
#21 FlexicontentFields::getFields() called at [D:\z2018\UniServerZ\www\cancer\components\com_flexicontent\views\item\view.html.php:196]
#22 FlexicontentViewItem->display() called at [D:\z2018\UniServerZ\www\cancer\libraries\src\MVC\Controller\BaseController.php:672]
#23 Joomla\CMS\MVC\Controller\BaseController->display() called at [D:\z2018\UniServerZ\www\cancer\components\com_flexicontent\controller.php:1222]
#24 FlexicontentController->display() called at [D:\z2018\UniServerZ\www\cancer\libraries\src\MVC\Controller\BaseController.php:710]
#25 Joomla\CMS\MVC\Controller\BaseController->execute() called at [D:\z2018\UniServerZ\www\cancer\components\com_flexicontent\flexicontent.php:266]
#26 require_once(D:\z2018\UniServerZ\www\cancer\components\com_flexicontent\flexicontent.php) called at [D:\z2018\UniServerZ\www\cancer\libraries\src\Component\ComponentHelper.php:402]
#27 Joomla\CMS\Component\ComponentHelper::executeComponent() called at [D:\z2018\UniServerZ\www\cancer\libraries\src\Component\ComponentHelper.php:377]
#28 Joomla\CMS\Component\ComponentHelper::renderComponent() called at [D:\z2018\UniServerZ\www\cancer\libraries\src\Application\SiteApplication.php:194]
#29 Joomla\CMS\Application\SiteApplication->dispatch() called at [D:\z2018\UniServerZ\www\cancer\libraries\src\Application\SiteApplication.php:233]
#30 Joomla\CMS\Application\SiteApplication->doExecute() called at [D:\z2018\UniServerZ\www\cancer\libraries\src\Application\CMSApplication.php:196]
#31 Joomla\CMS\Application\CMSApplication->execute() called at [D:\z2018\UniServerZ\www\cancer\index.php:49]
Last edit: 5 years 2 months ago by iamrobert.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.682 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline