Yes, I've noticed the continued performance issues. It remains to be seen whether my client will continue to use this extension. If they do, I'll probably tackle some more of these.
@eileen I'm on 8.1. Also this is replicable right now on https://dmaster.demo.civicrm.org.
@MickC @justinfreeman @Upperholme @I have a fix here: !78.
My client insisted I look into the cause of the API slowdown in #73. It ended up being fairly simple.
The API wrapper adds the "registered_participants_count" to every returned event.
If you use getsingle
, it gets this by (correctly) calling CRM_Event_BAO_Event::getParticipantCount()
. However, if you use get
, it calls Participant.get
to get the result count.
This has 2 problems:
getParticipantCount()
, because some registrations aren't counted against the available spaces. E.g. if I have a class with 25 open registrations, registering the teacher with the "Teacher" role shouldn't count against the 25.Event.get
will make a call to Participant.get
. So if you have 200 events, you're not making 1 API call, you're making 201.There's a relatively little-known feature of API3 Event.get
. If you pass the parameter is_full
, and the event has a registration cap, it will return a value available_spaces
. This a) gives a correct count, b) saves you all those additional API calls. This resolves the performance issue.
@BohdanDmytryshyn please review and let me know if you agree this is the correct fix?
JonGold (03ca12fb) at 21 Mar 22:06
Fix Event API performance
There are ongoing debates about good UX for failed invisible CAPTCHA errors but I don't like the existing answers. And the more I look at my suggested replacement in this MR, the less enthused I am about it. I was trying to avoid ReCAPTCHA
as a term not everyone knows, but I don't know that bot
is any better. And behavior
requires l10n for non-US English, which feels unnecessary.
So consider this an open bikeshed question - what can we tell the user that feels actionable to them, in non-technical language? I'll mull this for a day or two, but maybe the answer is jumping out at you.
JonGold (2687c552) at 21 Mar 19:25
Improve error message to account for invisible ReCAPTCHA.
... and 67 more commits
In "Manage Contribution Pages", clicking on the "Premiums" page gives a 500 error. This happens in 5.71 and master, not in 5.70.
See above.
This seems Smarty-related. I tried a git bisect
but there's a different issue that breaks this page that makes that difficult. However, below is the error and backtrace I get when I set XDebug to pause on error:
"Type of SmartyCompilerException:: must be int (as in class Exception)"
include (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smartycompilerexception.php:8)
Composer\Autoload\{closure:/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/vendor/composer/ClassLoader.php:575-577} (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/vendor/composer/ClassLoader.php:576)
Composer\Autoload\ClassLoader->loadClass (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/vendor/composer/ClassLoader.php:427)
Smarty_Internal_TemplateCompilerBase->trigger_template_error (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php:1153)
Smarty_Internal_CompileBase->closeTag (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compilebase.php:196)
Smarty_Internal_Compile_Private_Block_Plugin->compile (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_block_plugin.php:77)
Smarty_Internal_TemplateCompilerBase->callTagCompiler (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php:768)
Smarty_Internal_TemplateCompilerBase->compileTag2 (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php:1722)
Smarty_Internal_TemplateCompilerBase->compileTag (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php:565)
Smarty_Internal_Templateparser->yy_r45 (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php:2559)
Smarty_Internal_Templateparser->yy_reduce (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php:3481)
Smarty_Internal_Templateparser->doParse (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php:3573)
Smarty_Internal_SmartyTemplateCompiler->doCompile (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php:128)
Smarty_Internal_TemplateCompilerBase->compileTemplateSource (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php:481)
Smarty_Internal_TemplateCompilerBase->compileTemplate (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php:402)
Smarty_Template_Compiled->compileTemplateSource (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:184)
Smarty_Template_Compiled->process (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:141)
Smarty_Template_Compiled->render (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:105)
Smarty_Internal_Template->render (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:216)
Smarty_Internal_Template->_subTemplateRender (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:385)
content_65fa056d841377_41904664 (/home/jon/local/civicrm-buildkit/app/private/dmaster/default/civicrm/templates_c/en_US/3f/b3/c1/3fb3c10824e8bcce0275790f5b54d852eeb8a4d7_0.file.default.tpl.php:53)
Smarty_Template_Resource_Base->getRenderedTemplateCode (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:123)
Smarty_Template_Compiled->render (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:114)
Smarty_Internal_Template->render (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:216)
Smarty_Internal_Template->_subTemplateRender (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:385)
content_65fc658f02ae61_03133634 (/home/jon/local/civicrm-buildkit/app/private/dmaster/default/civicrm/templates_c/en_US/7e/52/3d/7e523d898add0d1ddbfb9d731ea772b38ca3b855_0.file.snippet.tpl.php:73)
Smarty_Template_Resource_Base->getRenderedTemplateCode (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:123)
Smarty_Template_Compiled->render (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:114)
Smarty_Internal_Template->render (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:216)
Smarty_Internal_TemplateBase->_execute (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:232)
Smarty_Internal_TemplateBase->fetch (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:116)
CRM_Core_QuickForm_Action_Display->renderForm (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php:117)
CRM_Core_QuickForm_Action_Display->perform (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php:83)
HTML_QuickForm_Controller->handle (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php:203)
HTML_QuickForm_Page->handle (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php:103)
CRM_Core_Controller->run (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/Controller.php:355)
CRM_Utils_Wrapper->run (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Utils/Wrapper.php:98)
CRM_Core_Invoke::runItem (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/Invoke.php:298)
CRM_Core_Invoke::_invoke (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/Invoke.php:69)
CRM_Core_Invoke::invoke (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/Invoke.php:36)
civicrm_invoke (/home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/drupal/civicrm.module:471)
menu_execute_active_handler (/home/jon/local/civicrm-buildkit/build/dmaster/web/includes/menu.inc:527)
{main} (/home/jon/local/civicrm-buildkit/build/dmaster/web/index.php:21)
JonGold (cdd239b6) at 19 Mar 19:23
better target only the quicksearch
JonGold (cdd239b6) at 19 Mar 19:23
better target only the quicksearch
Welcome @glanzel!
This issue tracker is for issues related to development of CiviCRM software, rather than issues with individual installations. As such, only issues that are in the most recent version of CiviCRM should be posted here.
Could you please try to replicate your issue at https://dmaster.demo.civicrm.org and report back if the issue is still present?
I'm not sure why this is closed - this is still very much an issue. I've been recommending clients against trialing this extension because of its bugs, but one insisted. It caused all their page loads on their CMS to take 4-5x longer to load.
A client site had very slow speeds when editing events, managing groups, etc. Simply loading the "Locations" tab on an event was taking 20 seconds.
XDebug Profiler tracked it down to the permissions check. After reviewing the permissions on various extensions, I removed the Event API wrapper, and the page loaded in 600ms.
I would need to do further profiling calling the API directly to determine the exact cause, and my client was only testing CiviMobile, but I thought I would pass it on.
I hit this error today - it's got the same root cause as #4969 (closed). But also noting that this code has been significantly rewritten in the upcoming Civi, so I'm going to implement the suggestion of @LeanderJCC locally, but I can't tell yet whether the problem still exists now.
I've implemented the basic suggestions here: https://github.com/civicrm/civicrm-core/pull/29756
When I saw the new tabbed interface for SK queries, I meant to submit a UX note. Today, one of my savvier clients was tripped up by the tab labels, which reminded me to come back.
Their particular error - they tried to add new columns with the "Select Fields" tab.
We should relabel that - I like "Field Transformations", but that conflicts with the rewrite on displays. Bikeshedding welcome, but this is better in than out.
"Query Info" is ambiguous - I recommend "Debugging" or "Developer Info".
"Configure Settings" is also ambiguous but I struggle for something better. This is query metadata, but I don't know a good non-technical term to unambiguously communicate that. The best I have is "Save Options" but most people would read "Save" as a verb, not a noun.
You can select fields under the "Select Fields" tab that aren't a column in the search, which leads to a crash on save. Is there a valid case for that? If not, we should limit the list. But that probably should be its own issue.
The change in 1.140 did a civix upgrade
, but only to version 22.05.2. This causes a 500 error on systems with Smarty 3 defined (which is recommended by a system check on Civi 5.69+).
My guess is you ran civix upgrade
but have an outdated version of civix
. Running civix upgrade
with a version from February 2023 or later resolves the issue.
I believe this should be affecting all folks when you're above the attendance cap - but calculating attendance for the purposes of the waitlist is tricky.
If you look at participant statuses, there's a "Class". Some are "Positive", some are "Negative", and some are "Waiting". If the number of only "positive" registrations matches your limit, you're going to get the "Event Full" message.
I'm going to close this since it's not related to CiviCRM development, but feel free to reference this ticket if you create a question on Stack Exchange.