The View contains:
Format: Table
Fields: (Title), (Date), (Category), (Type) and (File)
Filter Criteria Content: Published (Yes), Content: Type (Documents), Content: Date (Exposed Select Day)
Configure filter criterion: Content: Date (field_doc_date)
Appears in: node:Documents.
Expose this filter to visitors, to allow them to change it: CHECKED
Filter type to expose: Single filter: RADIO Selected
Operator: "Is Between"
________: Select a date > Month | Day | Year
Start date: Select a date > Month | Day | Year
End date: Enter a relative date > now +1 month
MORE
Administrative title:
Filter identifier > field_doc_date_value
Which does appear in the URL after the ? to identify this filter.
I feel that this error is due to the "Start Date" being empty upon the initial rendering.
After the initial rendering, the end user may select the "Date" column in order to sort the table without selecting a Start Date.
This causes the URL to send the request as: all?field_priv_doc_date_value[min]&field_priv_doc_date_value[max]&order=field_priv_doc_date&sort=asc
and following error is displayed:
Warning: Illegal string offset 'month' in date_select_element_value_callback() (line 467 of /home/www/html/precise/sites/all/modules/date/date_api/date_api_elements.inc).
Warning: Cannot assign an empty string to a string offset in date_select_element_value_callback() (line 467 of /home/www/html/precise/sites/all/modules/date/date_api/date_api_elements.inc).
Warning: Illegal string offset 'day' in date_select_element_value_callback() (line 467 of /home/www/html/precise/sites/all/modules/date/date_api/date_api_elements.inc).
Warning: Cannot assign an empty string to a string offset in date_select_element_value_callback() (line 467 of /home/www/html/precise/sites/all/modules/date/date_api/date_api_elements.inc).
Warning: Illegal string offset 'year' in date_select_element_value_callback() (line 467 of /home/www/html/precise/sites/all/modules/date/date_api/date_api_elements.inc).
Warning: Cannot assign an empty string to a string offset in date_select_element_value_callback() (line 467 of /home/www/html/precise/sites/all/modules/date/date_api/date_api_elements.inc).
Warning: Illegal string offset 'month' in drupal_array_set_nested_value() (line 6794 of /home/www/html/precise/includes/common.inc).
Error: Cannot create references to/from string offsets in drupal_array_set_nested_value() (line 6794 of /home/www/html/precise/includes/common.inc).
The function is looking for the [min][month], [min][day], [min][year], [max][month], [max][day] and [max][year].
If the Start Date is set to a value (e.g. 1/1/2019), it causes the URL to send the request as all?field_priv_doc_date_value[min][month]=1&field_priv_doc_date_value[min][day]=1&field_priv_doc_date_value[min][year]=2019&field_priv_doc_date_value[max][month]=6&field_priv_doc_date_value[max][day]=16&field_priv_doc_date_value[max][year]=2019
and then the error does not display.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | issue-3458997-cannot-access-type-string-on-string.patch | 746 bytes | alen simonyan |
Comments
Comment #2
damienmckennaFirst off, I'm sorry you're having this problem. Could you please try the latest 7.x-3.23 release and let us know if that resolves the problem? Thanks.
Comment #3
stevecory commentedThank you for your response. The system received the latest update 7.x-3.23 release and it did not resolve the problem.
Update information last refreshed: Fri, 05/17/2019 - 3:04pm
Name Installed Version Proposed version Message
Views (views) 7.x-3.22 7.x-3.23 Update available
Code updates will be made to the following projects: Views [views-7.x-3.23]
Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n): y
Project views was updated successfully. Installed version is now 7.x-3.23.
Backups were saved into the directory /root/drush-backups//20190517190440/modules/views. [ok]
No database updates required [success]
'all' cache was cleared.
The URL sent the request as:
all?field_doc_date_value[min]&field_doc_date_value[max]&order=field_doc_date&sort=asc
and the following error is displayed:
Warning: Illegal string offset 'month' in date_select_element_value_callback() (line 467 of /home/www/html/atn/sites/all/modules/date/date_api/date_api_elements.inc).
Warning: Cannot assign an empty string to a string offset in date_select_element_value_callback() (line 467 of /home/www/html/atn/sites/all/modules/date/date_api/date_api_elements.inc).
Warning: Illegal string offset 'day' in date_select_element_value_callback() (line 467 of /home/www/html/atn/sites/all/modules/date/date_api/date_api_elements.inc).
Warning: Cannot assign an empty string to a string offset in date_select_element_value_callback() (line 467 of /home/www/html/atn/sites/all/modules/date/date_api/date_api_elements.inc).
Warning: Illegal string offset 'year' in date_select_element_value_callback() (line 467 of /home/www/html/atn/sites/all/modules/date/date_api/date_api_elements.inc).
Warning: Cannot assign an empty string to a string offset in date_select_element_value_callback() (line 467 of /home/www/html/atn/sites/all/modules/date/date_api/date_api_elements.inc).
Warning: Illegal string offset 'month' in drupal_array_set_nested_value() (line 6794 of /home/www/html/atn/includes/common.inc).
Error: Cannot create references to/from string offsets in drupal_array_set_nested_value() (line 6794 of /home/www/html/atn/includes/common.inc).
Comment #4
stevecory commentedI tried not setting the Start Date and just selecting the "Apply" button.
It causes the URL to send the request as all?field_priv_doc_date_value[min][month]=&field_priv_doc_date_value[min][day]=&field_priv_doc_date_value[min][year]=&field_priv_doc_date_value[max][month]=&field_priv_doc_date_value[max][day]=&field_priv_doc_date_value[max][year]=&order=field_doc_date&sort=asc
and the error does not display.
Comment #5
ciss commentedWe've noticed the same problem after performing a Views update from cf53b40 to 2c4f62a (and switching from PHP 5 to PHP 7). For an exposed form with a number range filter "a" (a[min], a[max]), if the query string contains "a=foo", Drupal will attempt to set the value for the key "min" on the input string "foo":

Relevant snippet in _form_builder_handle_input_element():
Comment #6
entropea commentedWe were experiencing this issue and changed the form element of the filter from "text" to "popup" and this resolved the sorting issue.
Comment #7
lolcode commentedWe experienced this issue in D8 when a views block display with an exposed form was rendered in a core block entity reference field.
The block rendered OK but gave this error on the edit form.
Comment #8
adpo commentedHello, I have the same problem with DATE filters for D7 VIEWS and custom DB table table,
Database structure:
timestamp int(11)
Everying was fine until latest Drupal / Views upgrade. (edited)
Comment #9
norgef commented---
Comment #10
damienmckennaComment #11
alen simonyan commentedHi, I have created an issue https://www.drupal.org/project/drupal/issues/3458997, because the search didn't show this one.
I managed to fix this error with this patch.