Kolkata
Account created on 23 May 2019, about 5 years ago
#

Merge Requests

Recent comments

🇮🇳India arif.zisu Kolkata

Below code fix issue for me

diff --git a/docroot/sites/all/modules/colorbox/js/colorbox.js b/docroot/sites/all/modules/colorbox/js/colorbox.js
index cd7cf55e..f1d5cae1 100644
--- a/docroot/sites/all/modules/colorbox/js/colorbox.js
+++ b/docroot/sites/all/modules/colorbox/js/colorbox.js
@@ -33,15 +33,19 @@ Drupal.behaviors.initColorbox = {
.once('init-colorbox').each(function(){
// Only images are supported for the "colorbox" class.
// The "photo" setting forces the href attribute to be treated as an image.
- var extendParams = {
- photo: true
- };
- // If a title attribute is supplied, sanitize it.
- var title = $(this).attr('title');
- if (title) {
- extendParams.title = Drupal.colorbox.sanitizeMarkup(title);
+ if ($(this).hasClass('embed-video')) {
+ $(this).colorbox(settings.colorbox);
+ } else {
+ var extendParams = {
+ photo: true
+ };
+ // If a title attribute is supplied, sanitize it.
+ var title = $(this).attr('title');
+ if (title) {
+ extendParams.title = Drupal.colorbox.sanitizeMarkup(title);
+ }
+ $(this).colorbox($.extend({}, settings.colorbox, extendParams));
}
- $(this).colorbox($.extend({}, settings.colorbox, extendParams));
});

$(context).bind('cbox_complete', function () {
diff --git a/docroot/sites/all/modules/video_embed_field/video_embed_field.module b/docroot/sites/all/modules/video_embed_field/video_embed_field.module
index 7e9bedd5..81e79736 100644
--- a/docroot/sites/all/modules/video_embed_field/video_embed_field.module
+++ b/docroot/sites/all/modules/video_embed_field/video_embed_field.module
@@ -555,7 +555,8 @@ function video_embed_field_get_ajax_url($video_url, $video_style) {
'attributes' => array(
'class' => array(
'colorbox-load',
- 'colorbox'
+ 'colorbox',
+ 'embed-video'
),
),
'query' => array(

🇮🇳India arif.zisu Kolkata

@alena_stanul,
$options value will not work for boolean or empty value right (as it should be always array)??
So better to set empty array right ?? $options should always array right ??

🇮🇳India arif.zisu Kolkata

index eb9c2cd2..191472bc 100644
--- a/docroot/sites/all/modules/field_collection/field_collection.module
+++ b/docroot/sites/all/modules/field_collection/field_collection.module
@@ -1023,7 +1023,7 @@ function field_collection_entity_preload($entities, $langcode, &$items, $fields)

if ($rekey) {
// Rekey the items array.
- $new_items[$id] = array_values($new_items[$id]);
+ $new_items[$id] = ($new_items[$id] && is_array($new_items[$id])) ? array_values($new_items[$id]) : [];
}
}
field_collection_entity_preload($new_entities, $langcode, $new_items, $fields);

Fixed my issue

🇮🇳India arif.zisu Kolkata

diff --git a/docroot/sites/all/modules/contrib/variable/variable.module b/docroot/sites/all/modules/contrib/variable/variable.module
index 472bba70f..0cd2639f2 100644
--- a/docroot/sites/all/modules/contrib/variable/variable.module
+++ b/docroot/sites/all/modules/contrib/variable/variable.module
@@ -627,6 +627,7 @@ function _variable_language() {
* - language, Language object
*/
function _variable_options($options = array()) {
+ $options = [];
if (!empty($options['language'])) {
$options['langcode'] = $options['language']->language;
}

Fixed it

🇮🇳India arif.zisu Kolkata

diff --git a/docroot/sites/all/modules/contrib/ctools/includes/content.inc b/docroot/sites/all/modules/contrib/ctools/includes/content.inc
index 49c356502..0c67c91d0 100644
--- a/docroot/sites/all/modules/contrib/ctools/includes/content.inc
+++ b/docroot/sites/all/modules/contrib/ctools/includes/content.inc
@@ -293,7 +293,7 @@ function ctools_content_render($type, $subtype, $conf, $keywords = array(), $arg

$content = $function($subtype, $conf, $args, $pane_context, $incoming_content);

- if (empty($content)) {
+ if (empty($content) || !is_object($content)) {
return;
}

This patch solved my issue.

🇮🇳India arif.zisu Kolkata

After update XMLSitemap module , issue solved

🇮🇳India arif.zisu Kolkata

Hi ,

I have applied below patch to fix this

index 5ed4a4ce..95951d5e 100644
--- a/docroot/includes/path.inc
+++ b/docroot/includes/path.inc
@@ -328,7 +328,7 @@ function drupal_match_path($path, $patterns) {
     $patterns_quoted = preg_quote($patterns, '/');
     $regexps[$patterns] = '/^(' . preg_replace($to_replace, $replacements, $patterns_quoted) . ')$/';
   }
-  return (bool)preg_match($regexps[$patterns], $path);
+  return (bool)preg_match($regexps[$patterns], (string) $path);
 }

 /**

🇮🇳India arif.zisu Kolkata

Hi @Cilefen,
I am getting this error from my drupal watchdog files.

🇮🇳India arif.zisu Kolkata

Hi,

This form was working as expected at php 7.4 version , but issue at php 8.0 . I am trying to explain issue in details.

function mymodule_main_form($form, &$form_state)

{

// Check to see if anything has been stored.

if ($form_state['rebuild']) {

$form_state['input'] = array();

}

if (empty($form_state['storage'])) {

// No step has been set so start with the first.

$form_state['storage'] = array(

'step' => 'mymodule_step1_form',

);

}

// Return the current form

$function = $form_state['storage']['step'];

$form = $function($form, $form_state);

return $form;

}

function mymodule_main_form_submit($form, &$form_state)

{

$values = $form_state['values'];

if (isset($values['cancel']) && $values['op'] == $values['cancel']) {

// Moving back in form.

$step = $form_state['storage']['step'];

// Call current step submit handler if it exists to unset step form data.

if (function_exists($step . '_submit')) {

$function = $step . '_submit';

$function($form, $form_state);

}

// Remove the last saved step so we use it next.

$last_step = array_pop($form_state['storage']['steps']);

$form_state['storage']['step'] = $last_step;

} else {

// Record step.

$step = $form_state['storage']['step'];

$form_state['storage']['steps'][] = $step;

// Call step submit handler if it exists.

if (function_exists($step . '_submit')) {

$function = $step . '_submit';

$function($form, $form_state);

}

}

return;

}

function mymodule_step1_form($form, &$form_state)

{

if (!empty($form_state['storage'])) {

$values = $form_state['storage'];

}

$form['test1'] = array(

'#type' => 'textfield',

'#title' => t('test1'),

'#default_value' => isset($values['test1']) ? $values['test1'] : $test1,

);

$form['submit'] = array(

'#type' => 'submit',

'#value' => t('Activate'),

'#attributes' => array('class' => array('test_class')),

);

return $form;

}

 

function mymodule_step1_form_submit($form, &$form_state)

{

try {

$values = $form_state['values'];

$form_state['rebuild'] = TRUE;

$form_state['storage']['test1'] = $form_state['values']['test1'];

$form_state['storage']['step'] = 'mymodule_step2_form';

} catch (Exception $e) {

watchdog('test_error', 'Error: "!err"', array('!err' => $e->getMessage()));

}

}

function mymodule_step2_form($form, &$form_state)

{

$form['submit'] = array(

'#type' => 'submit',

'#value' => t('Confirm'),

'#attributes' => array('class' => array('test_class')),

);

$form['cancel'] = array(

'#type' => 'submit',

'#prefix' => ' ',

'#value' => t('Cancel'),

'#submit' => array('mymodule_step2_form_submit'),

'#attributes' => array('class' => array('test_class')),

);

return $form;

}

function mymodule_step2_form_submit($form, &$form_state)

{

$values = $form_state['values'];

print_r($values);

}

 

Inside some block we are rendering  mymodule_main_form

Like

$block = new stdClass();

$content = drupal_get_form('mymodule_main_form');

    if ($content) {

        $block->content = $content;

    }

return $block;    

So as per code it will render mymodule_step1_form as default  $form_state['storage']['step'] = 'mymodule_step1_form'

When we submit this form if will call mymodule_main_form_submit and it will go to the else part. Call mymodule_step1_form_submit.

Inside mymodule_step1_form_submit form_state rebuild true and set step  $form_state['storage']['step'] = 'mymodule_step2_form'

So it will go to again mymodule_main_form and render mymodule_step2_form.

After that if I click Confirm it will call mymodule_main_form_submit but  $step / $form_state['storage']['step'] still mymodule_step1_form. It will not update with mymodule_step2_form , So not able to call mymodule_step2_form_submit.

If I tigger cancel button , same issue.

Same form work for php7.

🇮🇳India arif.zisu Kolkata

We are facing same issue at D7 multistep form. After update PHP version 7.x to 8.x.
Anyone help me to provide some solution.

Production build 0.69.0 2024