logo

Palette - Դարձրեք այն գունավոր🎨

Palette — Վիզուալ էջեր կառուցող, դիզայնի դիպլոմ չի պահանջվում:

Առցանց դեմո Ներբեռնել Palette

Scroll

Սխալ՝ Անորոշ ինդեքս: լայնություն

22/02/2025, by Անանուն (չի ստուգվել)
Ֆորումներ

Բարի օր բոլորին!

Drupal 7-ում նկարների ցուցադրման համար տեղադրել եմ colorbox+multiupload+insert մոդուլների կապ:
Մի պահի (հավանաբար չեմ գրանցել) մեկ նկարի բեռնման ժամանակ հայտնվեց այս սխալը (եթե միանգամից բեռնում եք մի քանի, ապա համապատասխանաբար սխալների քանակը բազմապատկվում է բեռնվող նկարների քանակով):

Notice: Undefined index: width ֆունկցիայում template_preprocess_colorbox_insert_image() (158-րդ տող domen.ru/www/sites/all/modules/colorbox/colorbox.theme.inc ֆայլում):
Notice: Undefined index: height ֆունկցիայում template_preprocess_colorbox_insert_image() (159-րդ տող domen.ru/www/sites/all/modules/colorbox/colorbox.theme.inc ֆայլում):
Notice: Undefined index: width ֆունկցիայում template_preprocess_colorbox_insert_image() (158-րդ տող domen.ru/www/sites/all/modules/colorbox/colorbox.theme.inc ֆայլում):
Notice: Undefined index: height ֆունկցիայում template_preprocess_colorbox_insert_image() (159-րդ տող domen.ru/www/sites/all/modules/colorbox/colorbox.theme.inc ֆայլում):
Notice: Undefined index: width ֆունկցիայում template_preprocess_colorbox_insert_image() (158-րդ տող domen.ru/www/sites/all/modules/colorbox/colorbox.theme.inc ֆայլում):
Notice: Undefined index: height ֆունկցիայում template_preprocess_colorbox_insert_image() (159-րդ տող domen.ru/www/sites/all/modules/colorbox/colorbox.theme.inc ֆայլում):

Սխալի մեջ նշված ֆայլից կոդի հատված:

/**
* Preprocess variables for the colorbox-insert-image.tpl.php file.
*/
function template_preprocess_colorbox_insert_image(&$variables) {
$variables['file'] = file_load($variables['item']['fid']);
$variables['style_name'] = $variables['item']['style_name'];
$variables['width'] = $variables['item']['width'];                                            158-րդ տող
$variables['height'] = $variables['item']['height'];                                           159-րդ տող

Այդ դեպքում ամեն ինչ աշխատում է, ինչպես հարկն է: Բայց ուզում եմ ազատվել սխալից, քանի որ մի քանի նկարներ բեռնելու ժամանակ ստացվում է ավելորդ տեքստի էջի միջեւ «բերել» և հոդվածի բովանդակության միջև: Ֆորումը և ինտերնետը փորել եմ, բայց պատասխան չգտա:
Նախապես շնորհակալություն օգնության և համագործակցության համար:)