CiviCRM Core issueshttps://lab.civicrm.org/dev/core/-/issues2024-02-20T23:15:44Zhttps://lab.civicrm.org/dev/core/-/issues/4971Error when attempting to edit CiviEvent scheduled reminders2024-02-20T23:15:44ZrichardsplaygroundError when attempting to edit CiviEvent scheduled remindersOverview
----------------------------------------
A user with tries to edit a scheduled reminder on an event and sees only a blank screen. Logs show errors.
Strangely, they can create new scheduled reminders on events no problem. Bu...Overview
----------------------------------------
A user with tries to edit a scheduled reminder on an event and sees only a blank screen. Logs show errors.
Strangely, they can create new scheduled reminders on events no problem. But they then cannot edit the event scheduled reminder, not even for reminders they themselves created.
This occurs on CiviCRM 5.68 on Drupal 7 as well as on Civi 5.70.alpha1 generated today with buildkit drupal-demo.
** This worked on CiviCRM 5.52. There have been no changes to the user, roles, or permissions between it working on 5.52 and not working on 5.68. **
[Posted on StackExchange](https://civicrm.stackexchange.com/questions/46242/error-when-editing-but-not-creating-event-scheduled-reminder) but did not generate any discussion.
Role & Permissions
----------------------------------------
A user with "administrator" permissions can edit scheduled reminders on an event with no errors or issues.
A user with the following permissions receives an error when attempting to edit scheduled reminders on an event:
* CiviCRM: skip IDS check
* CiviCRM: access CiviCRM backend and API
* CiviEvent: access CiviEvent
* CiviEvent: edit event participants
* CiviEvent: edit all events
* CiviEvent: register for events
* CiviEvent: view event info
Error
----------------------------------------
When a user with the above permissions attempts to edit a scheduled reminder, what they see in the web UI is this:
![view_when_eventhelper_user_tries_to_edit_scheduled_reminder](/uploads/a0bec6e86da1d7bbba18334b5f64cc55/view_when_eventhelper_user_tries_to_edit_scheduled_reminder.png)
What the Javascript Console shows is this:
![console_error_when_eventhelper_tries_to_see_a_scheduled_event](/uploads/cfccaea9fe9336a7ad5bcb26545473a0/console_error_when_eventhelper_tries_to_see_a_scheduled_event.png)
What the logviewer shows is this on Civi 5.70.alpha1 (buildkit drupal-demo):
```
[error]
$Fatal Error Details = array:3 [
"message" => "Authorization failed"
"code" => null
"exception" => Civi\API\Exception\UnauthorizedException {#706
#message: "Authorization failed"
#code: 0
#file: "/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/Civi/API/Kernel.php"
#line: 230
#cause: null
-_trace: null
-errorData: array:1 [
"error_code" => "unauthorized"
]
trace: {
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/Civi/API/Kernel.php:230 {
Civi\API\Kernel->authorize($apiProvider, $apiRequest)
› if (!$event->isAuthorized()) {
› throw new \Civi\API\Exception\UnauthorizedException("Authorization failed");
› }
}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/Civi/API/Kernel.php:147 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/Civi/Api4/Generic/AbstractAction.php:256 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/api/api.php:91 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/CRM/Admin/Form.php:169 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/CRM/Admin/Form.php:79 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/CRM/Admin/Form/ScheduleReminders.php:50 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/CRM/Core/Form.php:731 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php:76 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/CRM/Core/Controller.php:355 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/CRM/Utils/Wrapper.php:98 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/CRM/Core/Invoke.php:295 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
/buildkit/build/drupal-demo/web/sites/all/modules/civicrm/drupal/civicrm.module:472 { …}
/buildkit/build/drupal-demo/web/includes/menu.inc:527 { …}
/buildkit/build/drupal-demo/web/index.php:21 { …}
}
}
]
2024-02-06 05:12:58+0000 [debug] $backTrace = #0 /buildkit/build/drupal-demo/web/sites/all/modules/civicrm/CRM/Core/Error.php(443): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /buildkit/build/drupal-demo/web/sites/all/modules/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(Civi\API\Exception\UnauthorizedException))
#2 /buildkit/build/drupal-demo/web/sites/all/modules/civicrm/drupal/civicrm.module(472): CRM_Core_Invoke::invoke((Array:4))
#3 /buildkit/build/drupal-demo/web/includes/menu.inc(527): civicrm_invoke("admin", "scheduleReminders", "edit")
#4 /buildkit/build/drupal-demo/web/index.php(21): menu_execute_active_handler()
#5 {main}
```
and what the logs show on a different system running CiviCRM 5.68 is this:
```
2024-01-15 15:30:56-0800 [debug] $API Request Authorization failed = #0 /var/www/html/sites/all/modules/civicrm/Civi/API/Kernel.php(151): CRM_Core_Error::backtrace("API Request Authorization failed", TRUE)
#1 /var/www/html/sites/all/modules/civicrm/Civi/Api4/Generic/AbstractAction.php(256): Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOGetAction))
#2 /var/www/html/sites/all/modules/civicrm/api/api.php(91): Civi\Api4\Generic\AbstractAction->execute()
#3 /var/www/html/sites/all/modules/civicrm/CRM/Admin/Form.php(161): civicrm_api4("ActionSchedule", "get", (Array:1))
#4 /var/www/html/sites/all/modules/civicrm/CRM/Admin/Form.php(77): CRM_Admin_Form->retrieveValues()
#5 /var/www/html/sites/all/modules/civicrm/CRM/Admin/Form/ScheduleReminders.php(50): CRM_Admin_Form->preProcess()
#6 /var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php(717): CRM_Admin_Form_ScheduleReminders->preProcess()
#7 /var/www/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(76): CRM_Core_Form->buildForm()
#8 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Admin_Form_ScheduleReminders), "display")
#9 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_ScheduleReminders), "display")
#10 /var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php(355): HTML_QuickForm_Page->handle("display")
#11 /var/www/html/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(98): CRM_Core_Controller->run()
#12 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(295): CRM_Utils_Wrapper->run("CRM_Admin_Form_ScheduleReminders", "Schedule Reminders", (Array:0))
#13 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:17))
#14 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:4))
#15 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(472): CRM_Core_Invoke::invoke((Array:4))
#16 /var/www/html/includes/menu.inc(527): civicrm_invoke("admin", "scheduleReminders", "edit")
#17 /var/www/html/index.php(21): menu_execute_active_handler()
#18 {main}
2024-01-15 15:30:56-0800 [error]
$Fatal Error Details = array:3 [
"message" => "Authorization failed"
"code" => null
"exception" => Civi\API\Exception\UnauthorizedException {#2401
-errorData: array:1 [
"error_code" => "unauthorized"
]
#cause: null
-_trace: null
#message: "Authorization failed"
#code: 0
#file: "/var/www/html/sites/all/modules/civicrm/Civi/API/Kernel.php"
#line: 230
trace: {
/var/www/html/sites/all/modules/civicrm/Civi/API/Kernel.php:230 {
Civi\API\Kernel->authorize($apiProvider, $apiRequest)
› if (!$event->isAuthorized()) {
› throw new \Civi\API\Exception\UnauthorizedException("Authorization failed");
› }
}
/var/www/html/sites/all/modules/civicrm/Civi/API/Kernel.php:147 { …}
/var/www/html/sites/all/modules/civicrm/Civi/Api4/Generic/AbstractAction.php:256 { …}
/var/www/html/sites/all/modules/civicrm/api/api.php:91 { …}
/var/www/html/sites/all/modules/civicrm/CRM/Admin/Form.php:161 { …}
/var/www/html/sites/all/modules/civicrm/CRM/Admin/Form.php:77 { …}
/var/www/html/sites/all/modules/civicrm/CRM/Admin/Form/ScheduleReminders.php:50 { …}
/var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php:717 { …}
/var/www/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php:76 { …}
/var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
/var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
/var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php:355 { …}
/var/www/html/sites/all/modules/civicrm/CRM/Utils/Wrapper.php:98 { …}
/var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php:295 { …}
/var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
/var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
/var/www/html/sites/all/modules/civicrm/drupal/civicrm.module:472 { …}
/var/www/html/includes/menu.inc:527 { …}
/var/www/html/index.php:21 { …}
}
}
]
2024-01-15 15:30:56-0800 [debug] $backTrace = #0 /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(443): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(Civi\API\Exception\UnauthorizedException))
#2 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(472): CRM_Core_Invoke::invoke((Array:4))
#3 /var/www/html/includes/menu.inc(527): civicrm_invoke("admin", "scheduleReminders", "edit")
#4 /var/www/html/index.php(21): menu_execute_active_handler()
#5 {main}
```
Reproduction steps
----------------------------------------
1. Build a buildkit drupal-demo
2. Log in as administrator, create a new role and give it the permissions noted above.
3. Create a new user ("eventhelper"), assign user this role.
4. (Still as administrator, or any other user) Create an event and create a scheduled reminder for the event.
5. Log out. Log in as eventhelper.
6. Go to the event, edit, go to the scheduled reminders tab, click edit next to the reminder.
Current behaviour
----------------------------------------
As above.
Expected behaviour
----------------------------------------
The user should be able to edit and save the scheduled reminder.
Comments
----------------------------------------
There are no permissions related to scheduled reminders. So although the log output says this is an authorization error, I don't see what authorization to give.
I'd also emphasize this worked in 5.52 with no changes to the user, role, or permissions.
Last, the user can create scheduled reminders on events, just not edit schedule reminders on events, even editing schedule reminders they themselves created. This is inconsistent so suggests a bug.colemanwcolemanwhttps://lab.civicrm.org/dev/core/-/issues/4970(regression) Extra receipt is sent when marking a contribution complete.2024-02-08T10:01:04ZJonGold(regression) Extra receipt is sent when marking a contribution complete.Overview
----------------------------------------
Starting in 5.69, changing a Pending contribution to Completed sends a receipt even if you choose not to.
Reproduction steps
----------------------------------------
1. Create a new pend...Overview
----------------------------------------
Starting in 5.69, changing a Pending contribution to Completed sends a receipt even if you choose not to.
Reproduction steps
----------------------------------------
1. Create a new pending contribution on the backend.
1. Click **Edit**.
1. Change the contribution to complete.
Current behaviour
----------------------------------------
If you don't select "Send Receipt", a receipt is sent.
If you *do* select "Send Receipt", 2 receipts are sent.
Expected behaviour
----------------------------------------
current situation minus 1.
Comments
----------------------------------------
The conversion from `transitionComponents()` to `Payment.create` is what occasioned this.5.69.5JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/4969Angular manager module caching issue (TypeError in_array)2024-03-18T21:46:01ZJKingsnorthAngular manager module caching issue (TypeError in_array)Related question was raised here: https://civicrm.stackexchange.com/questions/46379/typeerror-in-array-angular-managerresolvedefaultmodules-civicrm-version-5
I think this is a recent change which might have caused the issues (or highlig...Related question was raised here: https://civicrm.stackexchange.com/questions/46379/typeerror-in-array-angular-managerresolvedefaultmodules-civicrm-version-5
I think this is a recent change which might have caused the issues (or highlighted them): https://github.com/civicrm/civicrm-core/commit/604cca726c6a238e0530b5f660ab0e11596da090#diff-b26b657986ef8b8163e79bcaf85afe628f6d5457193253bc6ff4c009cca44bf5
---
We're seeing an intermittent issue where pages fail to load with a fatal error. The only path we've detected it on is /civicrm/transact .
It's caused by `\Civi\Angular\Manager::resolveDefaultModules` looking for the 'basePages' array for a module definition, but it's not there. After some checking, it looks like the value is just null (ie, there's no definition set).
Digging back through \Civi\Angular\Manager::getModules we can see that this checks to see if `$this->cache->get('moduleNames');` is null. If it is, it rebuilds the list of modules and saves it to the cache, and then goes through each module and saves the definition to the cache - using separate cache key entries (I guess because otherwise the cache entry would be too big?)
```
$angularModules = $this->resolvePatterns($angularModules);
$this->cache->set('moduleNames', array_keys($angularModules));
foreach ($angularModules as $moduleName => $moduleInfo) {
$this->cache->set("module $moduleName", $moduleInfo);
}
```
If `moduleNames` is already set, then it rehydrates the data from the cache:
```
// Rehydrate modules from cache
else {
foreach ($moduleNames as $moduleName) {
$angularModules[$moduleName] = $this->cache->get("module $moduleName");
}
```
The problem I think we're seeing intermittently is that `$this->cache->get('moduleNames');` is set but the individual module definitions (or some of them at least) are not set `$this->cache->get("module $moduleName");` . This means the value is set as 'NULL', which is causing the original error.
I'm struggling to find the exact steps to recreate this issue, but I think the related code could do with tightening up in either case?
It doesn't look like we can rely on the 'module ...' cache entries being set if the 'moduleNames' entry is set?
Ping @colemanwhttps://lab.civicrm.org/dev/core/-/issues/4968Can no longer edit status for a participant2024-02-07T18:56:07ZDaveDCan no longer edit status for a participant1. Register a participant. It doesn't happen with demo participants. Make a new participant.
2. Edit the participant and change status to e.g. Attended.
3. `ValueError: mysqli_query(): Argument 2 ($query) cannot be empty in mysqli_query(...1. Register a participant. It doesn't happen with demo participants. Make a new participant.
2. Edit the participant and change status to e.g. Attended.
3. `ValueError: mysqli_query(): Argument 2 ($query) cannot be empty in mysqli_query() (line 411 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php).`5.71.0https://lab.civicrm.org/dev/core/-/issues/4967Can no longer register someone for an event in the backend as pay-later2024-02-04T19:26:18ZDaveDCan no longer register someone for an event in the backend as pay-later1. Register someone in the backend for an event with status Pay-later.
2. Error: Please select at least one option from price set.1. Register someone in the backend for an event with status Pay-later.
2. Error: Please select at least one option from price set.https://lab.civicrm.org/dev/core/-/issues/4966Packaged SearchKit cannot be multilingual2024-02-03T18:48:06ZbgmPackaged SearchKit cannot be multilingualPackaged SearchKits, such as CiviCampaign, support translation into a single language, but not into multiple languages.
For example:
- Go to Admin > Localization > Languages
- Enable a second language (such as French), no need to enabl...Packaged SearchKits, such as CiviCampaign, support translation into a single language, but not into multiple languages.
For example:
- Go to Admin > Localization > Languages
- Enable a second language (such as French), no need to enable multi-lingual
- Enable the "language switcher" extension
- Leave the default site language to English
Then go to the Campaign Dashboard, and switch the language to French. The UI will still be mostly in English.
While still being in French, go to Administer > System Settings > Cleanup Cache: flush the cache.
Then reload the Campaign Dashboard, and it will be in French, but only in French.
CiviCRM stores the evaluated strings in the civicrm_search_display` table.https://lab.civicrm.org/dev/core/-/issues/4965Afform dies for contacts if no ID or contact_type2024-02-05T02:42:57ZufundoAfform dies for contacts if no ID or contact_typeA second slightly weird Afform edge case I hit today.
Example afform:
```A
<af-form ctrl="afform">
<af-entity data="{source: 'Enquiry form'}" type="Contact" name="Contact1" label="Contact email" actions="{create: true, update: true}"...A second slightly weird Afform edge case I hit today.
Example afform:
```A
<af-form ctrl="afform">
<af-entity data="{source: 'Enquiry form'}" type="Contact" name="Contact1" label="Contact email" actions="{create: true, update: true}" security="RBAC" />
<fieldset af-fieldset="Contact1" class="af-container" af-title="Contact">
<p class="af-text">Follow up contact email</p>
<div af-join="Email" data="{is_primary: true}">
<af-field name="email" />
</div>
</fieldset>
<button class="af-button btn btn-primary" crm-icon="fa-check" ng-click="afform.submit()" ng-if="afform.showSubmitButton">Submit</button>
</af-form>
```
The form gives on submit "No contact_type given to CRM_Contact_BAO_Contact::hasName".
It looks like the Afform api Submit action is trying to check whether a submitted contact entity has a name OR email (so is creatable) - but the name check throws an exception if no contact_type is provided - even if there was a viable email.
Potentially having a Contact entity without a specified contact_type is _a bad idea_ ... but I can see a use case like the above where you want people to be able to submit an email, that might then be deduped against contacts of any type? (Testing now I realise this doesn't work out-of-the-box because deduping is within contact types... but you might have some later hooks onto the submit event to deal with this maybe...?)
Potential patch incoming at any rate.https://lab.civicrm.org/dev/core/-/issues/4964Attaching multiple contacts to an activity in afform dies if one in the middl...2024-02-07T10:27:26ZufundoAttaching multiple contacts to an activity in afform dies if one in the middle is missingHit an issue today with trying to assign multiple contacts to an activity with an afform.
Example afform:
````
<af-form ctrl="afform">
<af-entity data="{source_contact_id: 'user_contact_id', activity_type_id: '1', **target_contact_id...Hit an issue today with trying to assign multiple contacts to an activity with an afform.
Example afform:
````
<af-form ctrl="afform">
<af-entity data="{source_contact_id: 'user_contact_id', activity_type_id: '1', **target_contact_id: ['Individual1', 'Individual2', 'Organization1']**}" type="Activity" name="Activity1" label="Activity 1" actions="{create: true, update: true}" security="RBAC" />
<af-entity data="{contact_type: 'Individual', source: 'Meeting Log'}" type="Contact" name="Individual1" label="Chair" actions="{create: true, update: true}" security="RBAC" />
<af-entity data="{contact_type: 'Individual', source: 'Meeting Log'}" type="Contact" name="Individual2" label="Minute Taker" actions="{create: true, update: true}" security="RBAC" />
<af-entity data="{contact_type: 'Organization', source: 'Meeting Log'}" type="Contact" name="Organization1" label="Host Organisation" actions="{create: true, update: true}" security="RBAC" />
<button class="af-button btn btn-primary" crm-icon="fa-check" ng-click="afform.submit()" ng-if="afform.showSubmitButton">Submit</button>
<fieldset af-fieldset="Activity1" class="af-container" af-title="Meeting">
<af-field name="subject" />
</fieldset>
<fieldset af-fieldset="Individual1" class="af-container" af-title="Chair">
<div class="af-container">
<div class="af-container af-layout-inline">
<af-field name="first_name" />
<af-field name="last_name" />
</div>
</div>
</fieldset>
<fieldset af-fieldset="Individual2" class="af-container" af-title="Minute Taker">
<div class="af-container">
<div class="af-container af-layout-inline">
<af-field name="first_name" />
<af-field name="last_name" />
</div>
</div>
</fieldset>
<fieldset af-fieldset="Organization1" class="af-container" af-title="Host Organisation">
<af-field name="organization_name" />
</fieldset>
</af-form>
```
Fill in all the contacts and you get an activity with 3 contacts.
If you skip Individual2 (Minute Taker), however... what happens? The Activity, Individual1 and the Organisation are created, but only Individual1 is linked to the Activity...
Think the issue is with the splicing here https://github.com/civicrm/civicrm-core/blob/1880f9bdfe20be6e1d0a47a74c2b480b6f27e055/ext/afform/core/Civi/Api4/Action/Afform/AbstractProcessor.php#L355 - patch incoming :slight_smile:https://lab.civicrm.org/dev/core/-/issues/4963(5.69 regression) Can't pay later on a membership price set2024-02-08T19:14:42ZJonGold(5.69 regression) Can't pay later on a membership price setIn 5.69, you can't select "Pay Later" for a membership price set. You get the warning "You cannot have auto-renewal on if you are paying later.", even when selecting a non-renewal option.
#### Steps to replicate
* On a demo site, chang...In 5.69, you can't select "Pay Later" for a membership price set. You get the warning "You cannot have auto-renewal on if you are paying later.", even when selecting a non-renewal option.
#### Steps to replicate
* On a demo site, change the "General" membership type to Auto-Renew required (reduce its membership term to 1 year also).
* Create a new price set with a single price field of type "Select".
* Provide both the General and Student options.
* Enable the price set on the membership contribution page, and enable "Pay Later".
* Select Student (which is *not* auto-renew), select "Pay Later", and attempt to submit.
I'm going to try to work on a fix, but I suspect #28871 or #28872 (or both) are the proximate cause. @eileen if something jumps out at you, let me know.5.70.0https://lab.civicrm.org/dev/core/-/issues/4962Resource URLs page doesn't load with Smarty32024-02-08T09:56:27ZJonGoldResource URLs page doesn't load with Smarty3Replicable on dmaster (and 5.69) by going to **Administer » System Settings » Resource URLs**.
Screen comes up mostly blank. This shows up in the PHP log.
```
PHP Warning: Undefined property: CRM_Admin_Form_Setting_Url::$_id in /home...Replicable on dmaster (and 5.69) by going to **Administer » System Settings » Resource URLs**.
Screen comes up mostly blank. This shows up in the PHP log.
```
PHP Warning: Undefined property: CRM_Admin_Form_Setting_Url::$_id in /home/jon/local/mysite/web/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php on line 2087"
PHP message: PHP Fatal error: Type of SmartyCompilerException::$line must be int (as in class Exception) in /home/jon/local/mysite/web/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smartycompilerexception.php on line 8"
```5.69.5https://lab.civicrm.org/dev/core/-/issues/4961SearchKit/API4: 'getFieldValue failed' error for group contacts2024-02-02T22:16:09Zaydunsaidan.saunders@squiffle.ukSearchKit/API4: 'getFieldValue failed' error for group contactsOverview
----------------------------------------
SearchKit/API4 fails with 'getFieldValue failed'
Reproduction steps
----------------------------------------
1. Create a new SearchKit search
1. Set 'Search for' to 'Groups'
1. Search a...Overview
----------------------------------------
SearchKit/API4 fails with 'getFieldValue failed'
Reproduction steps
----------------------------------------
1. Create a new SearchKit search
1. Set 'Search for' to 'Groups'
1. Search and confirm groups are shown
2. Add 'With (optional)' 'Group Contacts'
3. Search and observe no results
4. Open browser tools, search again, note '500':
Request is:
{"run":["SearchDisplay","run",{"return":"page:1","savedSearch":{"api_entity":"Group","displays":[],"groups":[],"tag_id":[],"api_params":{"version":4,"select":["id","title","description","is_active","Group_GroupContact_Contact_01.sort_name"],"orderBy":{},"where":[],"groupBy":[],"join":[["Contact+AS+Group_GroupContact_Contact_01","LEFT","GroupContact",["id","=","Group_GroupContact_Contact_01.group_id"]]],"having":[]},"label":"Group+Search+by+demo@example.com"},"sort":[],"limit":50,"seed":1706887602244,"filters":{},"afform":null,"debug":true}]}
Response is:
{
"run": {
"error_code": 0,
"error_message": "getFieldValue failed",
"status": 500
}
}
Environment information
----------------------------------------
* __CiviCRM:__ _Master_
Comments
----------------------------------------
This is currently failing on dmaster but works correctly on 5.65.0
Might be wider issue, but noted on groups.https://lab.civicrm.org/dev/core/-/issues/4960Regression: 5.70 active relationships not loading when Civi Case not enabled2024-02-03T02:54:13ZElliott EgglestonRegression: 5.70 active relationships not loading when Civi Case not enabledDisable CiviCase and navigate to a summary screen contact with relationships. In the tab list the Relationships tab is missing the count that shows up when CiviCase is enabled. If you click onto the tab you see the disabled relationships...Disable CiviCase and navigate to a summary screen contact with relationships. In the tab list the Relationships tab is missing the count that shows up when CiviCase is enabled. If you click onto the tab you see the disabled relationships but no enabled relationships load.
In the browser console you can see the following:
Post to https://dmaster.localhost:32353/civicrm/ajax/api4
with payload '{"run":["SearchDisplay","run",{"return":"page:1","savedSearch":"Contact_Summary_Relationships","display":"Contact_Summary_Relationships_Active","sort":{},"limit":50,"seed":1706885943746,"filters":{"near_contact_id":161,"is_current":true},"afform":"afsearchTabRel"}]}'
Comes back with 500 error
Object { error_code: 0, error_message: "API (Case, getLinks) does not exist (or the extension it belongs to is not enabled).", status: 500 }5.70.0https://lab.civicrm.org/dev/core/-/issues/4959After upgrading from 5.63. to 5.69, two scheduled jobs fail with: Failure, Er...2024-02-20T23:15:44ZjamieAfter upgrading from 5.63. to 5.69, two scheduled jobs fail with: Failure, Error message: Unknown api versionThe two failing jobs are:
- job.update_greeting
- mailing.update_mailing_resetdate
Both of these jobs have parameters entered in the job itself (which may be a clue). And, with both, I "fixed" them by adding:
version=3
To the list of...The two failing jobs are:
- job.update_greeting
- mailing.update_mailing_resetdate
Both of these jobs have parameters entered in the job itself (which may be a clue). And, with both, I "fixed" them by adding:
version=3
To the list of parameters already set.
I flailed around in `CRM/Core/JobManager.php` and found [an unset $temp variable](https://github.com/civicrm/civicrm-core/blob/6b7d77047024f4989d8fb2c9219d5ddf7e7161d0/CRM/Core/JobManager.php#L184) but was otherwise unable to figure out how to fix this problem.
Also, maybe not a bug and I should be adding this parameter? Or should the upgrader warn about adding this parameter? Or did I miss it? Thanks in advance for any clues.colemanwcolemanwhttps://lab.civicrm.org/dev/core/-/issues/4958Deprecated function CRM_Contact_BAO_ContactType::retrieve2024-03-15T20:43:33ZPradeep Nayakpradpnayak@gmail.comDeprecated function CRM_Contact_BAO_ContactType::retrieveOn edit of contact subtype get a deprecation error
/civicrm/admin/options/subtype/edit?action=update&id=2&reset=1
Deprecated function CRM_Contact_BAO_ContactType::retrieve, use API. CRM_Core_Error::deprecatedFunctionWarning CRM_Contact_...On edit of contact subtype get a deprecation error
/civicrm/admin/options/subtype/edit?action=update&id=2&reset=1
Deprecated function CRM_Contact_BAO_ContactType::retrieve, use API. CRM_Core_Error::deprecatedFunctionWarning CRM_Contact_BAO_ContactType::retrieve CRM_Admin_Form::retrieveValues CRM_Admin_Form::preProcess Array ( [civi.tag] => deprecated )
```2024-02-02 11:34:18+0000 [warning] Deprecated function CRM_Contact_BAO_ContactType::retrieve, use API.
CRM_Core_Error::deprecatedFunctionWarning
CRM_Contact_BAO_ContactType::retrieve
CRM_Admin_Form::retrieveValues
CRM_Admin_Form::preProcess
Array
(
[civi.tag] => deprecated
)
```https://lab.civicrm.org/dev/core/-/issues/4957attempt to access invalid property :_tagGroup Caller: CRM_Contact_Form_Edit_T...2024-02-08T09:56:27ZRobert J. Langattempt to access invalid property :_tagGroup Caller: CRM_Contact_Form_Edit_TagsAndGroups::buildQuickForm Array ( [civi.tag] => deprecated )Overview
----------------------------------------
After upgrading from a CiviCRM 5.67.1 site to 5.69.4-ESR, I saw many messages in the watchdog log like these resulting from loading a Membership Contribution page that contains checkboxe...Overview
----------------------------------------
After upgrading from a CiviCRM 5.67.1 site to 5.69.4-ESR, I saw many messages in the watchdog log like these resulting from loading a Membership Contribution page that contains checkboxes for mailing list groups in the profile:
* attempt to access invalid property :_tagGroup Caller: CRM_Contact_Form_Edit_TagsAndGroups::buildQuickForm Array ( [civi.tag] => deprecated )
* Notice: Indirect modification of overloaded property CRM_Contribute_Form_Contribution_Main::$_tagGroup has no effect in CRM_Contact_Form_Edit_TagsAndGroups::buildQuickForm() (line 112 of /mysite/modules/contrib/civicrm/CRM/Contact/Form/Edit/TagsAndGroups.php).
Furthermore, and more importantly, the checkboxes are no longer rendered at all on the form.
Since the error message says that `:_tagGroup` is an invalid property, a search through the CiviCRM code turns up several references to it `$form->_tagGroup` in file `civicrm/CRM/Contact/Form/Edit/TagsAndGroups.php` (including the line 112 cited in the message above).
Is there a straightforward fix for this? We signed up for ESR to reduce the need to regularly update, but can't update to the current ESR version when it breaks membership signups.https://lab.civicrm.org/dev/core/-/issues/4955Upgrade to Smarty52024-02-01T10:45:19ZeileenUpgrade to Smarty5Now that we have upgraded many sites to Smarty3 Smarty5 is on the cusp of being release....
See related issue https://lab.civicrm.org/dev/core/-/issues/4954 on getting to Smarty4
The upgrade from Smarty 3 or 4 to Smarty 5 has some mino...Now that we have upgraded many sites to Smarty3 Smarty5 is on the cusp of being release....
See related issue https://lab.civicrm.org/dev/core/-/issues/4954 on getting to Smarty4
The upgrade from Smarty 3 or 4 to Smarty 5 has some minor challenges.
https://smarty-php.github.io/smarty/5.x/upgrading/
1) assign_by_ref needs to be replaced with assign wherever it appears (yay I've been wanting to get rid of those)
2) some php-language modifiers will stop working without intervention (not sure how affected we are but if some are common it is easy to 'make them work')
3) before we can see / address the above there is a problem with our Smarty compatibility class. Our Smarty class has functions like `getTemplateVars()` to allow sites still on Smarty2 to call the v3 functions. That particular function has a different signature in Smarty5 so overriding it causes fatals
Proposal
1) Check Smarty5 into packages like Smarty4 - see https://github.com/civicrm/civicrm-packages/pull/380
2) the path fix in Smarty4 will allow easy switch to Smarty5 for developers
3) Move `getTemplateVars()` & any other functions in the same boat from being on our Smarty compatibility class to being 'hacked onto' the Smarty 2 code in our packages folder.
4) replace assign-by-ref with assign
- That should be enough to get us to the point where we can get dev sites to load and from there we can figure out if we have to scale a mountain or a molehill to move to Smarty5 instead of 3 or 4 when we do our force changehttps://lab.civicrm.org/dev/core/-/issues/4954Upgrade to Smarty4....2024-03-15T21:05:34ZeileenUpgrade to Smarty4....Now that we have upgraded many sites to Smarty3 & seem close to ironing out the issues I had a go at Smarty4 and was able to get it working. The extra fixes were entirely in our core compatibility layer so the challenges of moving a site...Now that we have upgraded many sites to Smarty3 & seem close to ironing out the issues I had a go at Smarty4 and was able to get it working. The extra fixes were entirely in our core compatibility layer so the challenges of moving a site from Smarty2 to Smarty4 are now equivalent to moving to Smarty3.
https://smarty-php.github.io/smarty/5.x/upgrading/#removed-php-constants
One annoying thing we did was name our Smarty mixin & the define in a version specific way. In fact there is nothing v2 specific about our mixin and the methodology of defining ` CIVICRM_SMARTY3_AUTOLOAD_PATH` works for Smarty4 as well as it does for Smarty3. If it wasn't for those naming issues I would recommend we simply replace the contents of packages/smarty3 with the Smarty 4 library.
However, given where we are I recommend we
1) merge Smarty4 into packages here https://github.com/civicrm/civicrm-packages/pull/380
2) add a new define `CIVICRM_SMARTY_AUTOLOAD_PATH` - respect it but fall back to `CIVICRM_SMARTY3_AUTOLOAD_PATH` if present
3) update our demo sites / build sites etc to Smarty4
4) update all our messaging to encourage people to use Smarty4 not 3 (but if they have already switched to 3 don't further message as being off Smarty2 is enough to flush out any extension or issues that would impede our medium term plans to put Smarty4 in vendor & stop shipping Smarty3
Note that Smarty4 hard-fails on `{php}` tags in tpls whereas Smarty3 has a backwards compatibility layer that would have supported it, had we chosen to enable it, which we didn't.5.72.0https://lab.civicrm.org/dev/core/-/issues/4953On a membership renewal, the member's existing membership is not preselected.2024-02-15T23:04:06ZrobbrandtOn a membership renewal, the member's existing membership is not preselected.After testing this with #4939, the issue still exists.
Our use case is with a membership price set, using a Select field type.
To replicate at the dmaster.demo.civicrm.org site, create a Membership Price Set, with one field. The field...After testing this with #4939, the issue still exists.
Our use case is with a membership price set, using a Select field type.
To replicate at the dmaster.demo.civicrm.org site, create a Membership Price Set, with one field. The field should be a Select type, and each of the 3 membership types should be added. Then change the existing Membership contribution page to use this price set rather than the manually entered one. Open the Live version of the contribution page, and sign up for any of the membership types and complete the transaction. Then go back to the live version of the contribution page and observe that the user's existing membership is not preselected.5.69.5https://lab.civicrm.org/dev/core/-/issues/4952PHP 8.3 Support2024-01-31T22:32:21ZJoeMurrayPHP 8.3 SupportThis is an epic for PHP 8.3 support.
PHP 8.3 was released 2023-11, has active support till 2024-12-8, and security support till 2025-12-08.
Some extra motivation to support 8.3 sooner rather that later is the significant performance im...This is an epic for PHP 8.3 support.
PHP 8.3 was released 2023-11, has active support till 2024-12-8, and security support till 2025-12-08.
Some extra motivation to support 8.3 sooner rather that later is the significant performance improvements it has, up to 55% for D10 over 8.1: https://kinsta.com/blog/php-benchmarks/
Reference: [https://www.php.net/manual/en/migration83.incompatible.php](https://www.php.net/manual/en/migration83.incompatible.php)
See also [thttps://php.watch/versions/8.3](https://php.watch/versions/8.3) and [https://www.php.net/releases/8.3/en.php](https://www.php.net/releases/8.3/en.php).
Here are the breaking changes listed here for reference. Almost all seem like they would be difficult to search for and identify in the codebase. Whack-a-mole from running on edge test servers might be a helpful approach.
- [ ] Uses of traits with static properties: Uses of traits with static properties will now redeclare static properties inherited from the parent class. This will create a separate static property storage for the current class. This is analogous to adding the static property to the class directly without traits.
- [ ] Assigning a negative index to an empty array: Assigning a negative index $n to an empty array will now make sure that the next index is $n+1 instead of 0.
- [ ] Class constant visibility variance check: Class constant visibility variance is now correctly checked when inherited from interfaces.
- [ ] WeakMap entries whose key maps to itself: WeakMap entries whose key maps to itself (possibly transitively) may now be removed during cycle collection if the key is not reachable except by iterating over the WeakMap (reachability via iteration is considered weak). Previously, such entries would never be automatically removed.
- [ ] Date: The DateTime extension has introduced Date extension specific exceptions and errors under the DateError and DateException hierarchies, instead of warnings and generic exceptions. This improves error handling, at the expense of having to check for errors and exceptions.
- [ ] DOM: Calling DOMChildNode::after(), DOMChildNode::before(), DOMChildNode::replaceWith() on a node that has no parent is now a no-op instead of a hierarchy exception, which is the behaviour demanded by the DOM specification.
Using the DOMParentNode and DOMChildNode methods without a document now works instead of throwing a DOM_HIERARCHY_REQUEST_ERR DOMException. This is in line with the behaviour demanded by the DOM specification.
Calling DOMDocument::createAttributeNS() without specifying a prefix would incorrectly create a default namespace, placing the element inside the namespace instead of the attribute. This bug is now fixed.
DOMDocument::createAttributeNS() would previously incorrectly throw a DOM_NAMESPACE_ERRNAMESPACE_ERR DOMException when the prefix was already used for a different URI. It now correctly chooses a different prefix when there's a prefix name conflict.
New methods and properties were added to some DOM classes. If a userland class inherits from these classes and declare a method or property with the same name, the declarations must be compatible. Otherwise, a typical compile error about incompatible declarations will be thrown. See the list of new features and new functions for a list of the newly implemented methods and properties.
- [x] FFI: C functions that have a return type of void now return null instead of returning the following object object(FFI\CData:void) { }
- [ ] Opcache: The opcache.consistency_checks INI directive was removed. This feature was broken with the tracing JIT, as well as with inheritance cache, and has been disabled without a way to enable it since PHP 8.1.18 and PHP 8.2.5. Both the tracing JIT and inheritance cache may modify shm after the script has been persisted by invalidating its checksum. The attempted fix skipped over the modifiable pointers but was rejected due to complexity. For this reason, it was decided to remove the feature instead.
- [ ] Phar: The type of Phar class constants are now declared.
- [ ] Standard: The range() function has had various changes:
A TypeError is now thrown when passing objects, resources, or arrays as the boundary inputs.
A more descriptive ValueError is thrown when passing 0 for $step.
A ValueError is now thrown when using a negative $step for increasing ranges.
If $step is a float that can be interpreted as an int, it is now done so.
A ValueError is now thrown if any argument is infinity or NAN.
An E_WARNING is now emitted if $start or $end is the empty string. The value continues to be cast to the value 0.
An E_WARNING is now emitted if $start or $end has more than one byte, only if it is a non-numeric string.
An E_WARNING is now emitted if $start or $end is cast to an integer because the other boundary input is a number. (e.g. range(5, 'z');).
An E_WARNING is now emitted if $step is a float when trying to generate a range of characters, except if both boundary inputs are numeric strings (e.g. range('5', '9', 0.5); does not produce a warning).
range() now produce a list of characters if one of the boundary inputs is a string digit instead of casting the other input to int (e.g. range('9', 'A');).
```
<?php
range('9', 'A'); // ["9", ":", ";", "<", "=", ">", "?", "@", "A"], as of PHP 8.3.0
range('9', 'A'); // [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], prior to PHP 8.3.0
?>
```
The file() flags error check now catches all invalid flags. Notably FILE_APPEND was previously silently accepted.
- [ ] SNMP: The type of SNMP class constants are now declared.https://lab.civicrm.org/dev/core/-/issues/4951Event registration under Windows fails2024-02-08T10:22:24ZspalmstromEvent registration under Windows fails## Overview
_This is similar to_ https://lab.civicrm.org/dev/core/-/issues/4928, but a different problem. See also Stack Exchange [smarty - Is it the end of the road for CiviCRM under Windows? - CiviCRM Stack Exchange](https://civicrm.s...## Overview
_This is similar to_ https://lab.civicrm.org/dev/core/-/issues/4928, but a different problem. See also Stack Exchange [smarty - Is it the end of the road for CiviCRM under Windows? - CiviCRM Stack Exchange](https://civicrm.stackexchange.com/questions/46268/is-it-the-end-of-the-road-for-civicrm-under-windows?noredirect=1#comment55844_46268) and [registration - Fatal error - unable to register for events with Smarty3 enabled - CiviCRM Stack Exchange](https://civicrm.stackexchange.com/questions/46311/fatal-error-unable-to-register-for-events-with-smarty3-enabled). I wonder if it is an issue with the use of Smarty3.
The final Register page crashes with:
```plaintext
The website encountered an unexpected error. Try again later.TypeError: Unsupported operand types: float + string in content_65ba5d1bd929c5_86413884() (line 408 of <drupal root>\vendor\civicrm\civicrm-packages\smarty3\vendor\smarty\smarty\libs\sysplugins\smarty_resource_recompiled.php(52) : eval()'d code).
```
followed by the stack trace.\`\`\`
## Reproduction steps
1. Register for an event.
2. Click on Review
3. Click on Register.
## Current behaviour
The web page returns:
```plaintext
The website encountered an unexpected error. Try again later.
TypeError: Unsupported operand types: float + string in content_65ba5d1bd929c5_86413884() (line 408 of <drupal root>\vendor\civicrm\civicrm-packages\smarty3\vendor\smarty\smarty\libs\sysplugins\smarty_resource_recompiled.php(52) : eval()'d code).
Smarty_Template_Resource_Base->getRenderedTemplateCode() (Line: 114)
Smarty_Template_Compiled->render() (Line: 216)
Smarty_Internal_Template->render() (Line: 232)
Smarty_Internal_TemplateBase->_execute() (Line: 116)
Smarty_Internal_TemplateBase->fetch() (Line: 24)
content_65ba5c676ca3f2_96523772() (Line: 123)
Smarty_Template_Resource_Base->getRenderedTemplateCode() (Line: 114)
Smarty_Template_Compiled->render() (Line: 216)
Smarty_Internal_Template->render() (Line: 232)
Smarty_Internal_TemplateBase->_execute() (Line: 116)
Smarty_Internal_TemplateBase->fetch() (Line: 1046)
CRM_Utils_String::parseOneOffStringThroughSmarty() (Line: 108)
Civi\Token\TokenCompatSubscriber->onRender() (Line: 220)
Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (Line: 56)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (Line: 263)
Civi\Core\CiviEventDispatcher->dispatch() (Line: 397)
Civi\Token\TokenProcessor->render() (Line: 327)
Civi\Token\TokenRow->render() (Line: 67)
CRM_Core_TokenSmarty::render() (Line: 374)
CRM_Core_BAO_MessageTemplate::renderTemplateRaw() (Line: 422)
CRM_Core_BAO_MessageTemplate::sendTemplate() (Line: 1254)
CRM_Event_BAO_Event::sendMail() (Line: 895)
CRM_Event_Form_Registration_Confirm->postProcess() (Line: 625)
CRM_Core_Form->mainProcess() (Line: 144)
CRM_Core_StateMachine->perform() (Line: 43)
CRM_Core_QuickForm_Action_Next->perform() (Line: 203)
HTML_QuickForm_Controller->handle() (Line: 103)
HTML_QuickForm_Page->handle() (Line: 355)
CRM_Core_Controller->run() (Line: 322)
CRM_Core_Invoke::runItem() (Line: 69)
CRM_Core_Invoke::_invoke() (Line: 36)
CRM_Core_Invoke::invoke() (Line: 88)
Drupal\civicrm\Civicrm->invoke() (Line: 83)
Drupal\civicrm\Controller\CivicrmController->main()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)
```
## Expected behaviour
A registration confirmation page is displayed.
## Environment information
* **Browser:** _Edge_ but probably irrelevant.
* **CiviCRM:** _5.69.3_
* **PHP:** _8.3.1_ but probably irrelevant.
* **CMS:** _Drupal 10.2.2_
* **Database:** _MySQL 8.0.36_ but probably irrelevant.
* **Web Server:** _IIS 10_
## Comments
_Anything else you would like the reviewer to note._
I have tried debugging the issue and spent quite some time on this. I raising it as an issue as my knowledge of Smarty isn't that great, but I hope a Smarty expert has better insight.
I think the issue is due to Smarty creating a template 'on the fly' rather than using a text file template. In the call stack, there is
CRM_Utils_String::parseOneOffStringThroughSmarty() (Line: 108) which passes `plaintext 'eval:{eval var=$smartySingleUseString|smarty:nodefaults}'`.
Incidentally, the line numbers on the call stack are strange, they seem out by one entity - `plaintext CRM_Utils_String::parseOneOffStringThroughSmarty() (Line: 108)` is actually line 1046 which is in the line above.
It seems that the system is calling some epheremal code which we can't see. The NetBeans call stack has transient entries like: ![image](/uploads/3a4859a5ff1b41a1152677863bfa1713/image.png)
You are able to step through the entity beginning with dbgp:// but cannot see the code. I have been unable to find content_65ba5d1bd929c5_86413884() during debugging, let alone see line 408. This makes debugging rather difficult. If one could see the template it was trying to process, it would help.5.69.5