Development issueshttps://lab.civicrm.org/groups/dev/-/issues2023-03-17T07:50:37Zhttps://lab.civicrm.org/dev/core/-/issues/4182Create a generic copy or clone api2023-03-17T07:50:37ZeileenCreate a generic copy or clone apiThis is a spin off of https://lab.civicrm.org/dev/core/-/issues/4130
I was looking at supporting import job templates & thought a clone or copy api makes sense.
I'm no longer prioritising this part & I think putting the code in the fo...This is a spin off of https://lab.civicrm.org/dev/core/-/issues/4130
I was looking at supporting import job templates & thought a clone or copy api makes sense.
I'm no longer prioritising this part & I think putting the code in the form layer or BAO layer for the specific entity is enouugh for now.
In order to clone the job the code looks something like
```
$userJob = UserJob::get()->addWhere('id', '=', $templateID)->execute()->first();
unset($userJob['metadata']['DataSource']['table_name'], $userJob['metadata']['submitted_values']['uploadFile'], $userJob['id'], $userJob['created_id'], $userJob['created_date'], $userJob['expires_date']);
$userJobID = UserJob::create(FALSE)->setValues($userJob)->execute()->first()['id'];
```
I feel like there is a case for a generic `Copy` api - in the `DAO` we have [a function with a signature that I think is probably 'a bit much'](https://github.com/civicrm/civicrm-core/blob/8bf6c5853cf76da43765cd8ef79d4323a442f350/CRM/Core/DAO.php#L1845-L1868) - so it might make sense to migrate to a new function... & create a generic API
I checked what Entities implement `Copy` and found a handful -the non static ones are not in the BAO - so we just have one non-std signature which is unused https://github.com/civicrm/civicrm-core/pull/25594
![image](/uploads/c4e1bbdf63fb79efaa06b03bca44fde4/image.png)
One option would be to add a parameter to the schema eg.
'is_not_clonable'
And then we could add that to fields like `created_id` and they would not need to be in the params. We already have the title of the entity so can assume that should be prefixed with `Copy Of`. The `UserJob` would have to override to set some of the deeper valueshttps://lab.civicrm.org/dev/core/-/issues/4181Custom fields on multiple entities2023-10-13T15:42:00Zaydunsaidan.saunders@squiffle.ukCustom fields on multiple entitiesOverview
----------------------------------------
Currently Custom Fields 'extend' one type of entity, possibly limited to one or more subtypes(*) of that entity.
Sometimes it would be useful to allow a set of Custom Fields to be linked...Overview
----------------------------------------
Currently Custom Fields 'extend' one type of entity, possibly limited to one or more subtypes(*) of that entity.
Sometimes it would be useful to allow a set of Custom Fields to be linked to multiple entities.
[(*) - "subtypes" in a broad sense. In the case of Contacts, the fields can be linked to sub-types. For entities like Activities, fields can be linked to say Phone Calls and Meetings which are not strictly subtypes]
Example use-case
----------------------------------------
1) Suppose we want to create custom fields for 'service providers'. Some 'service providers' are Organizations (subtype SP-O), some are Individuals (subtype SP-I).
Current options are:
- link the fields to Contacts - but the fields are only relevant to small proportion of Contacts.
- duplicate the custom fields for each subtype - need to search multiple similar fields that logically should be one.
2) Suppose we want to create a field common to multiple entities (eg 'is_validated' on Memberships, Contributions & Participants). This would require separate field sets per entity.
Current behaviour
----------------------------------------
The current model comes from a single inheritance background: this set of fields 'extends' a particular entity.
Proposed behaviour
----------------------------------------
A more flexible model is to think of a set of fields 'attached' to a selection of entities.
(Vaguely like PHP traits vs class inheritance.)
Comments
----------------------------------------
Looking for feedback on this in two main areas:
1) Is this desirable?
2) How practical is it? Custom fields are used very widely so figuring out a transition plan is key. If APIv4 can bridge the gap between the current situation and a new world then it becomes feasible. @colemanw - I know you've already done a load of work with APIv4 and Custom Fields and probably best placed to answer this bit.https://lab.civicrm.org/dev/core/-/issues/4180SearchKit does not respond to campaigns in mailings2023-03-17T07:47:36ZMariaVSearchKit does not respond to campaigns in mailingsI am trying to build a SearchKit where contacts who have received a mailing with a specific campaign within the last 6 months will no longer be displayed.
**My workaround at the moment:**
- First I enabled the option (CiviMail settings)...I am trying to build a SearchKit where contacts who have received a mailing with a specific campaign within the last 6 months will no longer be displayed.
**My workaround at the moment:**
- First I enabled the option (CiviMail settings) that for each mailing there will be also an activity added.
- The I have a second SearchKit that finds all contacts that have an activity with the campaign within the last 180 days and creates a smart group:
![image](/uploads/7fa530aae317f148486a460c1f63ca26/image.png)
- In my initial SearchKit I choose:
where "in Groups" Not One of "just mentioned smart group"
This works but it has the disadvantage of having 2 SearchKits and another smart group PLUS having an additional activity for each mailing.
**Expected behavior:**
- Having a "without" "Kontakt Mailing" entity where I can just filter those contacts out:
![image](/uploads/753b1ad0c824da4a7794d752ae7c6146/image.png)
I am also confused by the 3 options I have for Mailings:
![image](/uploads/5791966ad972bbc5194e7f796818f0ab/image.png)
What is the difference? Why are 3 options needed? It seems there is no option for the receiver. I have tried all 3 but when I sent out the mailing all the contacts remain in the SearchKit Table.
Is there any other solution that I might have missed?
Thanks in advance for any hint.https://lab.civicrm.org/dev/core/-/issues/4179Event online registration validation error under narrow conditions related to...2023-05-01T22:13:11ZAllenShawEvent online registration validation error under narrow conditions related to multiple participant, $0 fee, and contact reference field permissions: "Your payment information looks incomplete. Please go back to the main registration page, to complete ..."Under a very specific set of circumstances, users are unable to complete online event registration because of the validation error:
```
Please correct the following errors in the form fields below:
Your payment information looks incompl...Under a very specific set of circumstances, users are unable to complete online event registration because of the validation error:
```
Please correct the following errors in the form fields below:
Your payment information looks incomplete. Please go back to the main registration page, to complete payment information.
```
**Setup:**
To reproduce this you will need:
1. An event with the following characteristics:
* Configured for online registration, with multiple participants, and with pricing that allows for a $0 amount on the first participant.
* Includes a profile which contains a required contact reference field.
2. A user role with permissions to register for this event, but **without** the "access contact reference fields" permission.
**Repro steps:**
Once you have that set up you can reproduce as follows:
1. As a user with the given role, open the online registration form for this event.
2. Indicate that you are registering for two participants.
3. On the registration form for either of these two participants, you will notice that the contact reference field is not displayed, as expected in light of the user's permissions.
4. For the first participant, ensure that you select price options totaling $0.
5. Proceed to register the second participant, and for this participant ensure that you select a fee amount of greater than $0.
6. Submit the registration form for the second participant.
**Expected** behavior: The event registration is submitted without error (confirmation page or thank-you page is displayed, as appropriate per event configuration)
**Actual incorrect** behavior: Submission of the final participant form results in the above-stated validation error.
**Strict requirements for repro:**
It's worth noting that you can avoid this error by making any one or more of the following changes to the above steps or set up:
- as admin:
- Change permission so that this user can access contact reference fields.
- Do not make the contact reference field required in the profile.
- as user:
- For the first participant, select fees totaling greater than $0.
- For the second participant, select fees totalling $0.
**How the code allows this wackiness to happen:**
- [This line in CRM_Core_Form::validateMandatoryFields](https://github.com/civicrm/civicrm-core/blob/503cdb20e74866ffc68311c7c2be3cf9577a23bf/CRM/Core/Form.php#L2332) adds a validation error to the form if the required contact reference field has no value, without regard for whether the user had permissioned access to the field.
- [This line in CRM_Event_Form_Registration_AdditionalParticipant::validatePaymentValues](https://github.com/civicrm/civicrm-core/blob/master/CRM/Event/Form/Registration/AdditionalParticipant.php#L522) avoids calling `CRM_Core_Form::validateMandatoryFields()` if the first participant had a fee of more than $0.
(Joinery internal ticket reference: F#1041)https://lab.civicrm.org/dev/core/-/issues/4177Auto-generation of recurring contribution template ignores recurring amount2023-07-20T09:34:15ZAlanDixonAuto-generation of recurring contribution template ignores recurring amountOverview
----------------------------------------
When a recurring contribution does not have a corresponding template, sometimes one is generated implicitly (e.g. when viewing the 'template' and clicking 'done').
That 'implicit generat...Overview
----------------------------------------
When a recurring contribution does not have a corresponding template, sometimes one is generated implicitly (e.g. when viewing the 'template' and clicking 'done').
That 'implicit generation' does not pay attention to the amount in the recurring contribution record.
Reproduction steps
----------------------------------------
1. As an administrator, create a new recurring contribution for $1.
1. Observe that only the recurring contribution and contribution record are created, no recurring template contribution (requires mysql access to see this!).
1. Edit the recurring amount to $2. Note that there is still no recurring template.
1. View the recurring 'template' and click done. This implicitly creates the recurring record based on the $1 contribution, ignoring the $2 recurring contribution record amount, and as a side effect, modifies the recurring contribution record amount back to $1.
Current behaviour
----------------------------------------
The implicit generation of the recurring template does not respect the amount in the recurring record total.
Expected behaviour
----------------------------------------
It should! Of course, it's complicated. e.g. maybe that recurring template should get generated when the original recurring contribution is created?
I would note that I've only described one way that the template gets created, it appears there may be others. So regardless of whether we avoid this specific way of implicitly-generating the template, it should behave better than it does ...
Environment information
----------------------------------------
CiviCRM version: likely all versions since last June 2022.
Relevant docs link https://docs.civicrm.org/dev/en/latest/financial/recurring-contributions/https://lab.civicrm.org/dev/core/-/issues/4174FormBuilder: Server-side validation doesn't work2023-08-17T20:41:38ZJonGoldFormBuilder: Server-side validation doesn't workI've observed two different patterns on the master branch, but never the correct behavior.
##### Scenario 1
Basic FormBuilder form with a required date field. Date field doesn't properly client-side validate (see #4173) so it's submitt...I've observed two different patterns on the master branch, but never the correct behavior.
##### Scenario 1
Basic FormBuilder form with a required date field. Date field doesn't properly client-side validate (see #4173) so it's submitted. Server-side validation returns a 500 error. An unhelpful alert appears.
![ezgif-4-056315fd6a](/uploads/4df88302dca79440b03442d0b232029d/ezgif-4-056315fd6a.gif)
##### Scenario 2
Upon submitting, server-side validation is completely ignored and the form is submitted. I believe this happens when you have a non-required File field on the page.
![ezgif-2-2830537d8b](/uploads/1a5828a70ea9cb3f8d8b822bf4cf110a/ezgif-2-2830537d8b.gif)
Here is FormBuilder markup for both scenarios:
[scenario1-markup](/uploads/fbf2de2fe118e7a07f1cbdf2bc746628/scenario1-markup)
[scenario2-markup](/uploads/5256369eb51727d02c1ffe670f3f1b46/scenario2-markup)https://lab.civicrm.org/dev/core/-/issues/4172FormBuilder: silent failure if required fields not on form2023-03-13T07:41:58Zaydunsaidan.saunders@squiffle.ukFormBuilder: silent failure if required fields not on formOverview
----------------------------------------
FormBuilder does not show which fields are required to create an entity.
Reproduction steps
----------------------------------------
1. Create a new FormBuilder form
1. Add an activity
1...Overview
----------------------------------------
FormBuilder does not show which fields are required to create an entity.
Reproduction steps
----------------------------------------
1. Create a new FormBuilder form
1. Add an activity
1. Select the type as Meeting
1. Give the form a name, url and Save.
1. Go to the url just created
1. Enter firstname = test, lastname = test, activity subject = test, Submit
Current behaviour
----------------------------------------
The contact is created but the activity is not. Note there is no error message.
Expected behaviour
----------------------------------------
Run-time: Show an error if the activity cannot be created.
Form-save: warn if required fields have not been added to the form, so creation will fail.
Form-edit: indicate which fields are required by the API. Compare FB with API Explorer eg
FB:
![image](/uploads/a4a2cef38dfb59b21a38cb8149974f1f/image.png)
API Explorer:
![image](/uploads/b4b540f37f520c6da5a834f941a03cad/image.png)
Required fields are shown with red asterisk
Environment information
----------------------------------------
* __CiviCRM:__ _Master_ <!-- If this problem relates to an upgrade, then specify both old and new versions -->
Comments
----------------------------------------
Note this is about fields required by the API, not fields marked as required on the form.https://lab.civicrm.org/dev/core/-/issues/4171FormBuilder: Create options to style radio buttons/checkboxes2023-03-13T07:41:35ZJonGoldFormBuilder: Create options to style radio buttons/checkboxesCurrently, there's no way to configure the style of radio buttons/checkboxes within the FormBuilder UI. It also doesn't respect the "Options Per Line" setting of the custom field.
Ideally we could specify vertical/horizontal/columns for...Currently, there's no way to configure the style of radio buttons/checkboxes within the FormBuilder UI. It also doesn't respect the "Options Per Line" setting of the custom field.
Ideally we could specify vertical/horizontal/columns for options.https://lab.civicrm.org/dev/core/-/issues/4170FormBuilder: Allow placing fields outside their entity fieldset2023-03-13T07:41:15ZJonGoldFormBuilder: Allow placing fields outside their entity fieldsetFrom today's FormBuilder meeting:
Currently, the markup for a field doesn't specify its entity, in order to facilitate creating reusable blocks. However, it would be beneficial to allow specifying the entity for a field within the field...From today's FormBuilder meeting:
Currently, the markup for a field doesn't specify its entity, in order to facilitate creating reusable blocks. However, it would be beneficial to allow specifying the entity for a field within the field's markup.
This would allow a UX-friendly way of freely ordering fields on a form without regard to the entity.https://lab.civicrm.org/dev/core/-/issues/4167Transferred to Link in View Event Registration for {participant} Goes to a Pr...2023-03-09T09:20:26ZLKuttnerTransferred to Link in View Event Registration for {participant} Goes to a Previous EventSteps to Reproduce:
- View an event registration that has been transferred to another participant.
- In the Status line, Click the name of the participant that the registration has been transferred to.
- Example: _Status | Transferred (...Steps to Reproduce:
- View an event registration that has been transferred to another participant.
- In the Status line, Click the name of the participant that the registration has been transferred to.
- Example: _Status | Transferred (Transferred to Megan Nedzinski)_
- The link takes you to the registration for the first event that the person was ever registered for.
- The link does not take you to the latest registration that was just transferred to that contact.
- This only happens in the View Event Registration for {participant} page.
- In the Edit Event Registration for {participant} page, clicking the equivalent link does take you to the correct event.
This is using CiviCRM 5.55.1 on Drupal 7. I just noticed this and don't know how long this behavior has been in effect.https://lab.civicrm.org/dev/core/-/issues/4162Up/down arrow on pager on a contact's Events tab doesn't do the right thing.2023-03-07T07:27:22ZDaveDUp/down arrow on pager on a contact's Events tab doesn't do the right thing.1. Find a contact that has attended 51+ events. Note you can use the api Participant.create to quickly generate some records against the same event+contact since otherwise this is a lot of clicking.
* Note even if you change the defau...1. Find a contact that has attended 51+ events. Note you can use the api Participant.create to quickly generate some records against the same event+contact since otherwise this is a lot of clicking.
* Note even if you change the default pager size at search settings it seems hardcoded to 50.
1. Visit the contact's events tab.
1. Click the up arrow on the pager page control.
1. It takes you to a new register participant form instead of the next page.
The next/last links work ok.
What's interesting is that the url in the network tab seems correct, and if you visit it standalone it does seem to run the event search form correctly. So I suspect something about the context is getting lost in the session. The relevant code might be in CRM_Event_Page_Tab.https://lab.civicrm.org/dev/core/-/issues/4160Convert html special chars to their ascii equivalent in ical file generation2023-03-07T07:26:05ZyashodhaConvert html special chars to their ascii equivalent in ical file generationWhen an event is set to public, the event registration receipt includes a link to download a .ics (ical) file of the event.
This ICS file is generated on the fly, and adds the description of the event to the description field in the .ics...When an event is set to public, the event registration receipt includes a link to download a .ics (ical) file of the event.
This ICS file is generated on the fly, and adds the description of the event to the description field in the .ics. All html tags are stripped from the text, however special chars that have been converted to their html code are not converted back to ASCII in the .ics.
We need to update the generation of the .ics file to include the conversion of html char code back to ASCII equivalent.
e.g.
- è ; > è
- " ; > "
- Â ; > Â
-   ; > [space]
(put the space before ; so that one can see the char code)
etc...yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4159CiviBuild with Redis crashes when `Redis` has list of extensions cached & `ci...2023-03-07T07:25:36ZeileenCiviBuild with Redis crashes when `Redis` has list of extensions cached & `civibuild create` calledJust noting down the suggested fix
suppose that cv core:install generates civicrm.settings.php and includes a constant:
define('CIVICRM_DEPLOY_ID', 'SoMe_RaNdOM_1234')
the CIVICRM_DEPLOY_ID would be reset each time you reinstall. it co...Just noting down the suggested fix
suppose that cv core:install generates civicrm.settings.php and includes a constant:
define('CIVICRM_DEPLOY_ID', 'SoMe_RaNdOM_1234')
the CIVICRM_DEPLOY_ID would be reset each time you reinstall. it could be included as part of the prefix/key for memcache/redis and php-cache-files
s.t. if you do a civibuild reinstall, any cache derived from CIVICRM_DEPLOY_ID is guaranteed to be resethttps://lab.civicrm.org/dev/joomla/-/issues/46KC Finder Not Working Under Joomla 42023-12-11T14:04:46ZcrusonwebKC Finder Not Working Under Joomla 4I have discovered that currently KC Finder will not work under Joomla 4. If you click the Browse Server button when inserting an image into the editor using CKEditor 4, CKEditor 5 or TinyMCE you get a 500 error. I have recreated this o...I have discovered that currently KC Finder will not work under Joomla 4. If you click the Browse Server button when inserting an image into the editor using CKEditor 4, CKEditor 5 or TinyMCE you get a 500 error. I have recreated this on multiple client sites running Joomla 4.2.7 and 4.2.8 and CiviCRM 5.57.0 and 5.58.1. I have also recreated it on the Joomla 4 demo site, although I had to turn off Mosaico to do so (since it is on by default).
I did some digging and the problem appears to rest in the authenticate_joomla function within /packages/kcfinder/integration/civicrm.php which is using JFactory::getApplication('administrator'). Under Joomla 4, getApplication doesn't work the same way it did under Joomla 3 so you get the non-descript 500 error screen. I updated the code with the following block and that worked in most of my cases:
```
if (version_compare(JVERSION, '4.0.0', 'lt')) {
$mainframe = JFactory::getApplication('administrator');
$mainframe->initialise();
$user_id = JFactory::getUser()->id;
} else {
// Boot the DI container.
$container = \Joomla\CMS\Factory::getContainer();
// Alias the session service key to the web session service.
$container->alias(\Joomla\Session\SessionInterface::class, 'session.web.site');
// Get the application.
$app = $container->get(\Joomla\CMS\Application\AdministratorApplication::class);
$user_id = Joomla\CMS\Factory::getUser()->id;
}
```
In all but one case this got KC Finder working, that last case I ended up with the folder and file fields both saying "Unknown Error" which I am thinking is due to something specific to that site and not Civi. However, I am not 100% confident my approach is the right one so I wanted to raise this as an issue so another set of eyes could confirm or correct my solution.Monish DebMonish Debhttps://lab.civicrm.org/dev/core/-/issues/4143Smarty bus errors2023-02-24T22:05:21ZeileenSmarty bus errorsSmarty can show bus errors under load
See
Truncating a compiled template leads to concurrency issues if another process is including the same file. See also CRM-11189 for a description of the "bus error" encountered when one of the co...Smarty can show bus errors under load
See
Truncating a compiled template leads to concurrency issues if another process is including the same file. See also CRM-11189 for a description of the "bus error" encountered when one of the concurrent processes dies.
CRM-19013: Compiled templates are truncated
CRM-11189: When CiviMail renders smarty templates for mailing, it saves them to disk
https://github.com/civicrm/civicrm-packages/pull/158https://lab.civicrm.org/dev/core/-/issues/4139Form Builder: Display only field fixes for date, checkbox, radio, select and ...2023-02-24T07:10:42ZKurund JalmiForm Builder: Display only field fixes for date, checkbox, radio, select and entity ref fieldsCurrently, display only fields shows raw values which works well only for text fields.
We need to fix the display for the following data types:
- Date
- Select
- Checkbox
- Radio
- Select
- Entity RefCurrently, display only fields shows raw values which works well only for text fields.
We need to fix the display for the following data types:
- Date
- Select
- Checkbox
- Radio
- Select
- Entity RefKurund JalmiKurund Jalmihttps://lab.civicrm.org/dev/core/-/issues/4137Possible issue with Token processor and Smarty2023-03-03T20:07:08ZGuillaumeSorelPossible issue with Token processor and SmartyWhen using smarty logic with custom fields they don't get considered as numeric values any more so no calculation operation can be processed.
Sent as a 'normal' token, the token get merged. Nothing in the configuration changed. The custo...When using smarty logic with custom fields they don't get considered as numeric values any more so no calculation operation can be processed.
Sent as a 'normal' token, the token get merged. Nothing in the configuration changed. The custom are still declared as numeric.
If combined with smarty, they become simple 'text' values and in our situation nothing happens, when it should be.
This process was working since months until upgrading to 5.58.1 (on WP 6.1.1 and php 7.4) and was used many times to edit invoices:
```
{if $contact.custom_147==0}{else}- {contact.custom_147} Licences assurances annuelles = {$contact.custom_147*20}€{/if}
{if $contact.custom_154==0}{else}- {contact.custom_154} Licences assurances occasionnelles = {$contact.custom_154*15}€{/if}
{if $contact.custom_155==0}{else}- {contact.custom_155} Frais de gestion pour membre stagiaire en formation secourisme = {$contact.custom_155*10}€{/if}
{if $contact.custom_156==0}{else}- {contact.custom_156} Frais d'affiliation = {$contact.custom_156*150}€{/if}
Total réglé = {math equation="(op1*20)+(op2*15)+(op3*10)+(op4*150)" op1=$contact.custom_147 op2=$contact.custom_154 op3=$contact.custom_155 op4=$contact.custom_156}€
```
and this should show something like
- 2 Licences assurances annuelles = 40€
- 3 Frais de gestion pour membre stagiaire en formation secourisme = 30€
Total réglé = 70€https://lab.civicrm.org/dev/core/-/issues/4136Saving Repeating Events causes Registration date to be copied and/or overwritten2023-02-20T06:29:43ZshaneonabikeSaving Repeating Events causes Registration date to be copied and/or overwrittenOverview
----------------------------------------
Repeating Events are amazing for structuring recurring events. For a client, we had about 12 events scheduled and I wanted to add a new payment processor to those events. Upon adding tha...Overview
----------------------------------------
Repeating Events are amazing for structuring recurring events. For a client, we had about 12 events scheduled and I wanted to add a new payment processor to those events. Upon adding that to the Fees , and applying it to all the Events it changed all the ```Registration dates``` to match the first event :face_palm:
Reproduction steps
----------------------------------------
1. Create an Event
1. Set some fees and one payment processor
1. Set a Start date and Registration date a week before the start date
1. Set the repeat tab to ```Repeats every```: 1 month on the Third Thursday
1. Set an End after 11 occurrences
1. Save the Event choosing ```Every Event``` in the popup
1. Edit one of the Events
1. Check off another payment processor
1. Save the Event
1. The Registration date has changed on all the events
Expected behaviour
----------------------------------------
Basically, I was thinking that either A) we detect this is a modification and don't propagate OR B) we just don't propagate that field since it doesn't seem to make sense (at least to me) to do that on repeating events.https://lab.civicrm.org/dev/core/-/issues/4129API v4 explorer: boolean params don't render correctly for CV (short)2023-02-20T06:24:39ZnoahAPI v4 explorer: boolean params don't render correctly for CV (short)The API4 explorer generates shorthand `cv` syntax that looks like, for example:
````bash
cv api4 Contact.delete +w 'id = 99' checkPermissions=false useTrash=false
````
However, `cv` does not correctly interpret `false` in this context....The API4 explorer generates shorthand `cv` syntax that looks like, for example:
````bash
cv api4 Contact.delete +w 'id = 99' checkPermissions=false useTrash=false
````
However, `cv` does not correctly interpret `false` in this context. The syntax that works is:
````bash
cv api4 Contact.delete +w 'id = 99' checkPermissions=0 useTrash=0
````
So the explorer should generate that syntax.https://lab.civicrm.org/dev/core/-/issues/4125Use a maintenance template and theme for Drupal 8/9+ in CRM_Utils_System_Drup...2023-02-20T06:21:58ZherbdoolUse a maintenance template and theme for Drupal 8/9+ in CRM_Utils_System_Drupal8::theme() (follow up to dev/core#4076)In https://lab.civicrm.org/dev/core/-/issues/4076 we're splitting up the `theme()` method and putting it into each System class. The Drupal8 method doesn't behave like Drupal 7's, which uses the maintenance template and theme (without th...In https://lab.civicrm.org/dev/core/-/issues/4076 we're splitting up the `theme()` method and putting it into each System class. The Drupal8 method doesn't behave like Drupal 7's, which uses the maintenance template and theme (without the admin menu, etc). It would be nice if it did.
A first attempt looked like the following but it's missing the Civi core JS and CSS:
```
public function theme(&$content, $print = FALSE, $maintenance = FALSE) {
$ret = FALSE;
if (!$print) {
if ($maintenance) {
if ($region = CRM_Core_Region::instance('html-header', FALSE)) {
CRM_Utils_System::addHTMLHead($region->render(''));
}
$renderer = \Drupal::service('bare_html_page_renderer');
$build['content'] = [
'#markup' => \Drupal\Core\Render\Markup::create($content),
];
$civicrmPageState = \Drupal::service('civicrm.page_state');
$title = $civicrmPageState->getTitle();
$response = $renderer->renderBarePage($build, $title, 'maintenance_page');
print $response->getContent();
exit();
}
$ret = TRUE;
}
$out = $content;
if ($ret) {
return $out;
}
else {
print $out;
return NULL;
}
}
```