Ошибка в Panels for Drupal 6.*
Доброе утро!
В модуле panels для шестёрки есть неприятный косячёк который показывает себя следующими сообщениями об ошибке
* warning: Invalid argument supplied for foreach() in Z:\home\sceo.loc\www\sites\all\modules\panels\includes\plugins.inc on line 1225.
* warning: Invalid argument supplied for foreach() in Z:\home\sceo.loc\www\sites\all\modules\panels\includes\plugins.inc on line 1123.
Разработчики пока устранили его патчем.
Патч такой
Index: plugins.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/panels/includes/plugins.inc,v
retrieving revision 1.12
diff -u -r1.12 plugins.inc
--- plugins.inc 3 Sep 2008 02:13:19 -0000 1.12
+++ plugins.inc 3 Sep 2008 18:55:19 -0000
@@ -1120,9 +1120,11 @@
*/
function panels_context_get_keywords($contexts) {
$keywords = array();
- foreach ($contexts as $id => $context) {
- if ($keyword = $context->get_keyword()) {
- $keywords["%$keyword"] = $context->get_title();
+ if (!empty($contexts)){
+ foreach ($contexts as $id => $context) {
+ if ($keyword = $context->get_keyword()) {
+ $keywords["%$keyword"] = $context->get_title();
+ }
}
}
return $keywords;
@@ -1222,9 +1224,11 @@
* Return the first context with a form id from a list of contexts.
*/
function panels_context_get_form($contexts) {
- foreach ($contexts as $context) {
- if (!empty($context->form_id)) {
- return $context;
+ if (!empty($contexts)) {
+ foreach ($contexts as $context) {