Drupal StackExchange

Convert UTC to local time in date field

1 month 3 weeks ago

I have a content type with a date field, which I convert to a specific date format in a preprocess function:

$variables['date'] = \Drupal::service('date.formatter')->format($variables['node']->field_datum->date->getTimestamp(), 'long_date_without_time');

But as Germany is one hour ahead, a date like 2015-03-31 23:01:08 UTC converts to 1. April 2015. How can I convert this to our local time?

EDIT: I already set the correct timezone in the UI. And I just saw that the wrong dates are only shown when I set my system time between 11pm and 1 am...

0711master

Remove order from Field Collection set in form

1 month 3 weeks ago

I am using the Field Collection and Field Collection Fieldset modules to group a set of elements in my form. But what i see in the form is an Order column for the fieldset items, which i would like to hide, as shown in the below screenshot.

I have tried a lot to figure out if i can hide the Order from the backend, but i could not find a setting for it anywhere. So i am now looking forward to use a hook, to hide it. I also checked the field level structure using Devel module and dpm($form); but i have no idea on how to accomplish this. Can anyone help me?

shasi kanth

How would I override misc/ui/jquery.ui.theme.css

1 month 3 weeks ago

I have theming being automatically applied by misc/jquery.ui.theme.css that I need to modify. I am using Views Accordian plugin in an instance of EVA for a FAQ category.

What is the Drupal way to override some of the css in this instance?

I read the "How to override a theme function?" but I don't think it would work in this case, I could be wrong.

fndtn357

How can I have the file upload destination private by default?

1 month 3 weeks ago

Currently Webform file component uses public files as default upload destination. This is probably because private files path is not always available if not configured in Drupal settings correctly.

File upload destination should be made automatically "private files" by default if available.

I found same issue with Drupal7, is there any patch or way for Drupal8?

Or better if we do it by some setting in the local.settings.php or some similar cofniguraions?

https://www.drupal.org/forum/support/upgrading-drupal/2012-10-08/changing-public-file-field-into-private

Nasser Ali Karimi

Optional parameter $path declared before required parameter $langcode is implicitly treated as a required parameter in include_once()

1 month 3 weeks ago

I've just updated from PHP 7.4 to 8.1 and on the whole everything appears to be working. However I'm seeing the following over and over in our logs, to the point that it's drowning out everything else. Bootstrap.inc looks to be a part of Core? is there a fix for those of us still stuck on Drupal 7?

Deprecated function: Optional parameter $path declared before required parameter $langcode is implicitly treated as a required parameter in include_once() (line 1439 of [server_path]/includes/bootstrap.inc).
somnolentsurfer

Trying to make a custom webform element that references other elements from the same form

1 month 3 weeks ago

My goal is to add a custom element to webforms that allows webform editors to subscribe submission posters to a mailchimp mailing list. This used to be a feature in one of the existing modules but was dropped after Drupal 7. The goal is to add an element to the form that allows the form editor (not the submiter) to specify which of the form fields is the email that should be used for registration, which checkbox in the form is the user consent checkbox (this one is optional as it could be setup via the built-in conditions system), and to select from a list of mailchimp audiences (mailing lists) which one to use during subscription. This element does not display anything in the rendered form nor save any data to the submission. The subscription operation will happen in a form handler. The part I am having trouble figuring out (from the available webform element example) is how to add configuration sections and custom content in those sections. The most appropriate section seems to be in the General section within the fieldset named after the element. The goal is to add either two or three drop downs for this new element type which will allow selecting the email field, the consent field and the target mailing list.

The part I need assistance with is how to add those configuration dropdown fields to my custom form element configuration section and how to reference existing form elements in some of those.

An alternative (potentially cleaner) would be do perform the whole thing with a custom handler. In this case the question becomes how to add the references to the form's fields in the handlers's configuration section.

Vitch612

How to create a chart about a date range if some dates in this range are missing?

1 month 3 weeks ago

I use charts module Charts and I want to create a view that shows the stats from a date range.

I have an exposed filter and this filter has a between range. I want to show all dates from values of exposed filter.

I provided the values 7/10/2015 and 15/10/2015 as my date range and always show the dates if no stats exist for specific days in this range.

For example: 7/10/2015, 8/10/2015, 9/10/2015, 10/10/2015, 11/10/2015, etc. up to 15/10/2015,

Attached an image to understand what I want (how the chart should look like).

How can I do this, with filter, arguments or handlers, please give me a example.

For this moment the module "views between date filter" is not working as I want: it only shows all dates for which some data exist. But always need show the dates that no have results.

jonathan

Acquia Status

Acquia has temporarily disabled Acquia Cloud Professional signups

1 month 3 weeks ago

Mar 18, 13:27 UTC
Resolved - Acquia has enabled Acquia Cloud Professional signups following our planned maintenance. All services are operational at this time.

Mar 15, 21:16 UTC
Monitoring - Acquia has temporarily disabled Acquia Cloud Professional signups for planned maintenance over the weekend and will enable functionality on Monday at approximately 13:00 UTC.