- Issue created by @styrbaek
- Status changed to Needs review
2 months ago 5:13am 2 September 2025
When using Paragraphs Sets module with PHP 8.3, a deprecation notice appears:
Deprecated function: Increment on non-alphanumeric string is deprecated in paragraphs_sets_field_widget_complete_form_alter() (line 272 of paragraphs_sets.module)
This occurs when incrementing $insert_delta which may be a non-numeric value. The issue appears in the paragraphs sets module when adding paragraphs "in between" existing paragraphs.
if (isset($insert_delta)) {
ParagraphsSets::prepareDeltaPosition($field_state, $form_state, [$field_name], $insert_delta);
$insert_delta++;
}
if (isset($insert_delta)) {
ParagraphsSets::prepareDeltaPosition($field_state, $form_state, [$field_name], $insert_delta);
$insert_delta = (int)$insert_delta;
$insert_delta++;
}
The fix ensures that $insert_delta is explicitly cast to an integer before incrementing it, which resolves the PHP 8.3 deprecation notice while maintaining the same functionality.
diff --git a/paragraphs_sets.module b/paragraphs_sets.module
index abc123..def456 789
--- a/paragraphs_sets.module
+++ b/paragraphs_sets.module
@@ -269,7 +269,8 @@ function paragraphs_sets_field_widget_complete_form_alter(array &$field_widget_comp
$max++;
if (isset($insert_delta)) {
ParagraphsSets::prepareDeltaPosition($field_state, $form_state, [$field_name], $insert_delta);
+ $insert_delta = (int)$insert_delta;
$insert_delta++;
}
When using Paragraphs Sets module with PHP 8.3, a deprecation notice appears:
Deprecated function: Increment on non-alphanumeric string is deprecated in paragraphs_sets_field_widget_complete_form_alter() (line 272 of paragraphs_sets.module)
This occurs when incrementing $insert_delta which may be a non-numeric value. The issue appears in the paragraphs sets module when adding paragraphs "in between" existing paragraphs.
if (isset($insert_delta)) {
ParagraphsSets::prepareDeltaPosition($field_state, $form_state, [$field_name], $insert_delta);
$insert_delta++;
}
if (isset($insert_delta)) {
ParagraphsSets::prepareDeltaPosition($field_state, $form_state, [$field_name], $insert_delta);
$insert_delta = (int)$insert_delta;
$insert_delta++;
}
The fix ensures that $insert_delta is explicitly cast to an integer before incrementing it, which resolves the PHP 8.3 deprecation notice while maintaining the same functionality.
diff --git a/paragraphs_sets.module b/paragraphs_sets.module
index abc123..def456 789
--- a/paragraphs_sets.module
+++ b/paragraphs_sets.module
@@ -269,7 +269,8 @@ function paragraphs_sets_field_widget_complete_form_alter(array &$field_widget_comp
$max++;
if (isset($insert_delta)) {
ParagraphsSets::prepareDeltaPosition($field_state, $form_state, [$field_name], $insert_delta);
+ $insert_delta = (int)$insert_delta;
$insert_delta++;
}
Active
3.0
Code