Patch for drupal. how-to. Патчим вручную модули.
При редактировании материала в Drupal 7 выскочила ошибка "Warning: Parameter 1 to icl_content_node_prepare() expected to be a reference, value given in module_invoke_all()"
гугл показал на страничку с официальным патчем. Устанавливать git или что-то в этом духе посчитал не нужным потому как не программер а одно изменение пока не трудно повторить столько раз сколько надо ;). Дураков работа любит а потому поехали патчить вручную. Вот фрагмент патча:
? translation_management-node-hooks-by-value.patch.txt
Index: icl_content/icl_content.wrapper.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/translation_management/icl_content/icl_content.wrapper.inc,v
retrieving revision 1.3
diff -u -r1.3 icl_content.wrapper.inc
--- icl_content/icl_content.wrapper.inc 14 Sep 2010 09:06:42 -0000 1.3
+++ icl_content/icl_content.wrapper.inc 29 Dec 2010 22:05:30 -0000
@@ -27,21 +27,21 @@
/**
* Implements hook_node_insert().
*/
-function icl_content_node_insert(&$node) {
+function icl_content_node_insert($node) {
icl_content_nodeapi($node, 'insert');
}
/**
* Implements hook_node_update().
*/
-function icl_content_node_update(&$node) {
+function icl_content_node_update($node) {
icl_content_nodeapi($node, 'update');
}
/**
* Implements hook_node_delete().
*/
-function icl_content_node_delete(&$node) {
+function icl_content_node_delete($node) {
icl_content_nodeapi($node, 'delete');
}
@@ -57,48 +57,48 @@
/**
=========================
еще одна ошибка
http://drupal.org/node/1024298
when ical localisation is on have errors output
* Notice: Undefined index: method in drupal_prepare_form() (line 937 of /home/www/drupal7/includes/form.inc).
* Notice: Undefined index: #title in _icl_content_retrieve_title() (line 154 of /home/www/drupal7/sites/all/modules/translation_management/icl_content/icl_content.contentype.inc).
http://drupal.org/files/translation-manager.patch
Index: icl_content/icl_content.module
===================================================================
--- icl_content/icl_content.module (revision 255)
+++ icl_content/icl_content.module (working copy)
@@ -997,7 +997,7 @@
}
}
- } else if ($op == 'prepare' && ! isset ( $node->icanlocalize ) && $node->nid) {
+ } else if ($op == 'prepare' && ! isset ( $node->icanlocalize ) && isset($node->nid)) {
$node->icanlocalize = array ();
foreach ( array_keys ( _icl_content_statuses ( $node->nid, 'node' ) ) as $code ) {
$node->icanlocalize [] = $code;
как видно, минусом обозначены строки которые надо удалить а плюсом измененные строки которые надо поставить на место удаленных строк. Что и было сделано вручную ( кстати работу ускорил тот факт что разница между разными вариантами - один символ, который я просто удалил из исходных строк.
Вот и все. Ошибка пропала, чего я и добивался этим патчем!
- Войдите на сайт для отправки комментариев