Problem/Motivation
In https://git.drupalcode.org/project/conditional_fields/-/blob/4.x/src/Con... we're doing a
$values = preg_split("/[\r\n]+/g", $value_data);
There is no /g regex modifier in PHP and it therefore throws the following warning.
Warning: preg_split(): Unknown modifier 'g' in Drupal\conditional_fields\ConditionalFieldsHandlerBase->getConditionValues() (line 37 of modules/contrib/conditional_fields/src/ConditionalFieldsHandlerBase.php).
It most likely came from a regex conversion from JS to PHP, because JS has that modifier.
Steps to reproduce
Proposed resolution
Remove the modifier. It should not have any effect anyhow.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | fix_regex_modifier.patch | 531 bytes | sadeghbayan |
Comments
Comment #2
sadeghbayan commentedHi @szeidler, thanks for reporting the issue.
here's the patch to fix the issue.
Comment #3
szeidler commentedComment #4
szeidler commentedLooks good.
Comment #5
socialnicheguru commentedAlso worked for me
Comment #7
heddnThanks for the contributions here.