リソースを複製するとテンプレート変数がすべてクリアされる  【解決済み】

質問全般・改善要望
返信する
アバター
min-o
メンバー
メンバー
記事: 324
登録日時: 2009年10月07日(水) 18:32

リソースを複製するとテンプレート変数がすべてクリアされる

投稿記事 by min-o »

-----
ご利用のサーバ: さくらインターネット
Webサーバのバージョン :
PHPのバージョン :5.2.17
データベースのバージョン :5.1.51-log
MODXのバージョン : 1.0.6J-r6
 ※http://forum.modx.jp/viewtopic.php?f=7&t=899
  「リソース作成画面から画像をアップロードできません」のパッチ追加済み
ブラウザ :fierfox13
-----

お世話になっております。
1.0.6J-r5から1.0.6J-r6にアップデートしたところ、
既存のリソースを複製した場合に、テンプレート変数の値がすべてクリアされるようになってしまいました。

今まではテンプレート変数はすべて複製もとの値が引き継がれていました。
製品紹介のページでテンプレート変数を20個以上使っているため、似たリソースを複製して入力の手間を省いていました。
複製するたびに入力しなおすのは地味に手間なので、元のようにテンプレート変数も引き継ぐようにできないでしょうか?

よろしくお願いします。
---------
おのうちみん
http://scifitique.org/
http://gender-sf.org/
アバター
yama
管理人
記事: 3251
登録日時: 2009年7月29日(水) 02:50

Re: リソースを複製するとテンプレート変数がすべてクリアされる

投稿記事 by yama »

添付のパッチを /manager/processors/ ディレクトリに上書きしてみていただけますでしょうか。
添付ファイル
duplicate_content.processor.zip
(2.21 KiB) ダウンロード数: 455 回
アバター
min-o
メンバー
メンバー
記事: 324
登録日時: 2009年10月07日(水) 18:32

Re: リソースを複製するとテンプレート変数がすべてクリアされる

投稿記事 by min-o »

yamaさん返信ありがとうございます。

添付のファイルを上書きし、リソースを開いて複製したところ以下のエラーが出ました。
※サイト名ドメイン名****の伏字にしてます。
---------------------
Undefined index: a
? MODX Parse Error ?
MODX encountered the following error while attempting to parse the requested resource:
? Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'contentid,tmplvarid,value' at line 1 ?
SQL:INSERT `****`.`modx_site_tmplvar_contentvalues` contentid,tmplvarid,value
Basic info
REQUEST_URI : /manager/index.php?id=3819&a=94
Manager action : 94 - Duplicate resource
Referer : http://****.co.jp/manager/index.php?a=27&id=3819
User Agent : Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1
IP : 222.151.197.6
Parser timing
MySQL : 0.0926 s (5 Requests)
PHP : 0.0528 s
Total : 0.1454 s

Backtrace
1 include_once() manager/index.php on line 622
2 duplicateDocument() manager/processors/duplicate_content.processor.php on line 31
3 duplicateTVs() manager/processors/duplicate_content.processor.php on line 117
4 insert() manager/processors/duplicate_content.processor.php on line 179
5 __insert() manager/includes/extenders/dbapi.mysql.class.inc.php on line 286
6 query() manager/includes/extenders/dbapi.mysql.class.inc.php on line 331

Warning: Cannot modify header information - headers already sent by (output started at /home/****/www/home/manager/includes/document.parser.class.inc.php:3664) in /home/****/www/home/manager/includes/document.parser.class.inc.php on line 3659
Undefined index: a
? MODX Parse Error ?
MODX encountered the following error while attempting to parse the requested resource:
? Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'document,document_group' at line 1 ?
SQL:INSERT `****`.`modx_document_groups` document,document_group
Basic info
REQUEST_URI : /manager/index.php?id=3819&a=94
Manager action : 94 - Duplicate resource
Referer : http://****.co.jp/manager/index.php?a=27&id=3819
User Agent : Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1
IP : 222.151.197.6
Parser timing
MySQL : 0.1005 s (6 Requests)
PHP : 0.2388 s
Total : 0.3393 s

Backtrace
1 include_once() manager/index.php on line 622
2 duplicateDocument() manager/processors/duplicate_content.processor.php on line 31
3 duplicateAccess() manager/processors/duplicate_content.processor.php on line 118
4 insert() manager/processors/duplicate_content.processor.php on line 187
5 __insert() manager/includes/extenders/dbapi.mysql.class.inc.php on line 286
6 query() manager/includes/extenders/dbapi.mysql.class.inc.php on line 331

Warning: Cannot modify header information - headers already sent by (output started at /home/****/www/home/manager/includes/document.parser.class.inc.php:3664) in /home/****/www/home/manager/processors/duplicate_content.processor.php on line 39
----------

複製はできましたが、テンプレート変数はクリアされたままです。
---------
おのうちみん
http://scifitique.org/
http://gender-sf.org/
アバター
yama
管理人
記事: 3251
登録日時: 2009年7月29日(水) 02:50

Re: リソースを複製するとテンプレート変数がすべてクリアされる

投稿記事 by yama »

あ、なるほどですね。汗
またあとでパッチ作ります
アバター
yama
管理人
記事: 3251
登録日時: 2009年7月29日(水) 02:50

Re: リソースを複製するとテンプレート変数がすべてクリアされる

投稿記事 by yama »

さっきのファイルは元に戻していただいて、添付のファイルをmanager/includes/extenders/ ディレクトリに上書きしてみてください
添付ファイル
dbapi.mysql.class.inc.zip
パッチ
(4.67 KiB) ダウンロード数: 487 回
アバター
min-o
メンバー
メンバー
記事: 324
登録日時: 2009年10月07日(水) 18:32

Re: リソースを複製するとテンプレート変数がすべてクリアされる  【解決済み】

投稿記事 by min-o »

添付のパッチで、無事、複製してもテンプレート変数が引き継がれるようになりました!
ありがとうございました :D
---------
おのうちみん
http://scifitique.org/
http://gender-sf.org/
返信する