■ユーザーズフォーラム リニューアルのお知らせ
新規投稿は新ユーザーズフォーラムにお願いします。

ツイッタープラグインのアプリ認証でエラーがでます。

pocopenweb > ツイッタープラグインのアプリ認証でエラーがでます。 @ 2010/10/19 16:50
いつもお世話になり、ありがとうございます。
ツイッタープラグインのことで教えていただきたいのですがプラグインの登録後、アプリ認証がうまくいきません。
デバッグモード1で確認してみるとTwitter のサイトの認証ページからBaserCMS の管理画面にもどってくる際に

Notice (8): Only variable references should be returned by reference [CORE/baser/vendors/OAuth/oauth_consumer.php, line 109]
Notice (8): Trying to get property of non-object [APP/plugins/twitter/models/behaviors/twitter.php, line 170]
Notice (8): Trying to get property of non-object [APP/plugins/twitter/models/behaviors/twitter.php, line 171]
Warning (2): Cannot modify header information - headers already sent by (output started at /home/pocopen/public_html/cake/libs/debugger.php:503) [CORE/cake/libs/controller/controller.php, line 646]

と表示されてアプリケーションの登録に失敗してしまいます。
度々のご質問で恐縮ですが、今回もよろしくお願いいたします。

■ BaserCMSのバージョン:1.6.6
■ レンタルサーバー名:usamimi.info
■ スマートURLの利用:ON
■ 設置フォルダ:ドキュメントルート
■ 利用しているデータベース:MySQL
pocopenweb > Re: ツイッタープラグインのアプリ認証でエラーがでます。 @ 2010/10/20 11:14
追記です。
かなり長いですがエラーメッセージを展開したものを貼らせていただきます。
どうぞよろしくお願いいたします。

Notice (8): Only variable references should be returned by reference [CORE/baser/vendors/OAuth/oauth_consumer.php, line 109]
Code | Context
$response = array()
}

return null;
OAuth_Consumer::createOAuthToken() - CORE/baser/vendors/OAuth/oauth_consumer.php, line 109
OAuth_Consumer::doRequest() - CORE/baser/vendors/OAuth/oauth_consumer.php, line 157
OAuth_Consumer::getAccessToken() - CORE/baser/vendors/OAuth/oauth_consumer.php, line 61
TwitterBehavior::getAccessToken() - APP/plugins/twitter/models/behaviors/twitter.php, line 169
ModelBehavior::dispatchMethod() - CORE/cake/libs/model/behavior.php, line 159
BehaviorCollection::dispatchMethod() - CORE/cake/libs/model/behavior.php, line 431
Model::call__() - CORE/cake/libs/model/model.php, line 459
Overloadable::__call() - CORE/cake/libs/overloadable_php5.php, line 51
Twitter::getAccessToken() - APP/plugins/twitter/controllers/twitter_configs_controller.php, line 101
TwitterConfigsController::authorize_callback() - APP/plugins/twitter/controllers/twitter_configs_controller.php, line 101
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 109

Notice (8): Trying to get property of non-object [APP/plugins/twitter/models/behaviors/twitter.php, line 170]
Code | Context
$Model = Twitter
Twitter::$name = "Twitter"
Twitter::$plugin = "Twitter"
Twitter::$useTable = false
Twitter::$actsAs = array
Twitter::$driver = ""
Twitter::$useDbConfig = "baser"
Twitter::$displayField = NULL
Twitter::$id = NULL
Twitter::$data = array
Twitter::$table = "twitters"
Twitter::$primaryKey = "id"
Twitter::$_schema = NULL
Twitter::$validate = array
Twitter::$validationErrors = array
Twitter::$tablePrefix = NULL
Twitter::$alias = "Twitter"
Twitter::$tableToModel = array
Twitter::$logTransactions = false
Twitter::$transactional = false
Twitter::$cacheQueries = false
Twitter::$belongsTo = array
Twitter::$hasOne = array
Twitter::$hasMany = array
Twitter::$hasAndBelongsToMany = array
Twitter::$Behaviors = BehaviorCollection object
Twitter::$whitelist = array
Twitter::$cacheSources = true
Twitter::$findQueryType = NULL
Twitter::$recursive = 1
Twitter::$order = NULL
Twitter::$__exists = NULL
Twitter::$__associationKeys = array
Twitter::$__associations = array
Twitter::$__backAssociation = array
Twitter::$__insertID = NULL
Twitter::$__numRows = NULL
Twitter::$__affectedRows = NULL
Twitter::$_findMethods = array
Twitter::$_log = NULL
$Session = SessionComponent
SessionComponent::$__active = true
SessionComponent::$__bare = 0
SessionComponent::$valid = true
SessionComponent::$error = array
SessionComponent::$_userAgent = ""
SessionComponent::$path = "/"
SessionComponent::$lastError = 2
SessionComponent::$security = "medium"
SessionComponent::$time = 1287540584
SessionComponent::$sessionTime = 1287626984
SessionComponent::$watchKeys = array
SessionComponent::$id = NULL
SessionComponent::$_started = true
SessionComponent::$host = "www.pocopenweb.com"
SessionComponent::$_log = NULL
SessionComponent::$enabled = true
SessionComponent::$cookieLifeTime = 604800
$requestToken = null
$accessToken = null
$requestToken = $Session->read('request_token');
$accessToken = $this->consumer->getAccessToken( $this->accessTokenUri, $requestToken);
$this->accessTokenKey = $accessToken->key;
TwitterBehavior::getAccessToken() - APP/plugins/twitter/models/behaviors/twitter.php, line 170
ModelBehavior::dispatchMethod() - CORE/cake/libs/model/behavior.php, line 159
BehaviorCollection::dispatchMethod() - CORE/cake/libs/model/behavior.php, line 431
Model::call__() - CORE/cake/libs/model/model.php, line 459
Overloadable::__call() - CORE/cake/libs/overloadable_php5.php, line 51
Twitter::getAccessToken() - APP/plugins/twitter/controllers/twitter_configs_controller.php, line 101
TwitterConfigsController::authorize_callback() - APP/plugins/twitter/controllers/twitter_configs_controller.php, line 101
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 109

Notice (8): Trying to get property of non-object [APP/plugins/twitter/models/behaviors/twitter.php, line 171]
Code | Context
$Model = Twitter
Twitter::$name = "Twitter"
Twitter::$plugin = "Twitter"
Twitter::$useTable = false
Twitter::$actsAs = array
Twitter::$driver = ""
Twitter::$useDbConfig = "baser"
Twitter::$displayField = NULL
Twitter::$id = NULL
Twitter::$data = array
Twitter::$table = "twitters"
Twitter::$primaryKey = "id"
Twitter::$_schema = NULL
Twitter::$validate = array
Twitter::$validationErrors = array
Twitter::$tablePrefix = NULL
Twitter::$alias = "Twitter"
Twitter::$tableToModel = array
Twitter::$logTransactions = false
Twitter::$transactional = false
Twitter::$cacheQueries = false
Twitter::$belongsTo = array
Twitter::$hasOne = array
Twitter::$hasMany = array
Twitter::$hasAndBelongsToMany = array
Twitter::$Behaviors = BehaviorCollection object
Twitter::$whitelist = array
Twitter::$cacheSources = true
Twitter::$findQueryType = NULL
Twitter::$recursive = 1
Twitter::$order = NULL
Twitter::$__exists = NULL
Twitter::$__associationKeys = array
Twitter::$__associations = array
Twitter::$__backAssociation = array
Twitter::$__insertID = NULL
Twitter::$__numRows = NULL
Twitter::$__affectedRows = NULL
Twitter::$_findMethods = array
Twitter::$_log = NULL
$Session = SessionComponent
SessionComponent::$__active = true
SessionComponent::$__bare = 0
SessionComponent::$valid = true
SessionComponent::$error = array
SessionComponent::$_userAgent = ""
SessionComponent::$path = "/"
SessionComponent::$lastError = 2
SessionComponent::$security = "medium"
SessionComponent::$time = 1287540584
SessionComponent::$sessionTime = 1287626984
SessionComponent::$watchKeys = array
SessionComponent::$id = NULL
SessionComponent::$_started = true
SessionComponent::$host = "www.pocopenweb.com"
SessionComponent::$_log = NULL
SessionComponent::$enabled = true
SessionComponent::$cookieLifeTime = 604800
$requestToken = null
$accessToken = null
$accessToken = $this->consumer->getAccessToken( $this->accessTokenUri, $requestToken);
$this->accessTokenKey = $accessToken->key;
$this->accessTokenSecret = $accessToken->secret;
TwitterBehavior::getAccessToken() - APP/plugins/twitter/models/behaviors/twitter.php, line 171
ModelBehavior::dispatchMethod() - CORE/cake/libs/model/behavior.php, line 159
BehaviorCollection::dispatchMethod() - CORE/cake/libs/model/behavior.php, line 431
Model::call__() - CORE/cake/libs/model/model.php, line 459
Overloadable::__call() - CORE/cake/libs/overloadable_php5.php, line 51
Twitter::getAccessToken() - APP/plugins/twitter/controllers/twitter_configs_controller.php, line 101
TwitterConfigsController::authorize_callback() - APP/plugins/twitter/controllers/twitter_configs_controller.php, line 101
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 109

Warning (2): Cannot modify header information - headers already sent by (output started at /home/pocopen/public_html/cake/libs/debugger.php:503) [CORE/cake/libs/controller/controller.php, line 646]
Code | Context
$status = "Location: http://www.pocopenweb.com/admin/twitter/twitter_configs/form"
header - [internal], line ??
Controller::header() - CORE/cake/libs/controller/controller.php, line 646
Controller::redirect() - CORE/cake/libs/controller/controller.php, line 627
TwitterConfigsController::authorize_callback() - APP/plugins/twitter/controllers/twitter_configs_controller.php, line 123
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 109
ryuring > Re: ツイッタープラグインのアプリ認証でエラーがでます。 @ 2010/10/21 3:05
こんばんは。

間違いなく、オブジェクトの生成に失敗しているようです。
また、参照渡しに関するエラーが発生していますね。

PHPのバージョンはわかりますか?

Twitter:@ryuring
baserCMS総合サービスサイト ビーコミ

pocopenweb > Re: ツイッタープラグインのアプリ認証でエラーがでます。 @ 2010/10/21 3:17
ryuringさま、いつもお世話になります。
お返事ありがとうございます。

確認しましたところ、PHP Version 5.3.3 でした。
どうぞよろしくお願いいたします。
ryuring > Re: ツイッタープラグインのアプリ認証でエラーがでます。 @ 2010/10/21 4:03
引用:
確認しましたところ、PHP Version 5.3.3 でした。


なるほど・・

PHPは、5.3で仕様が変わったというか、厳格になっており、
ほとんどのレンタルサーバーはまだ、5.2系を利用しているところが多いようです。

そういう事もあり、実は、BaserCMSも、PHPの5.2系で開発されており、5.3系でのテストが行われていないのが現状です。

もちろん、5.3系への対応は必須項目ですが、優先順位は低くなってしまいます。。


ところで、PHPの知識はありますか?
ログを見たところ、/baser/vendors/OAuth/oauth_consumer.phpに原因があるのは間違いないようです。
createRequestメソッドや、doRequestメソッドあたりがあやしいです。

Twitter:@ryuring
baserCMS総合サービスサイト ビーコミ

pocopenweb > Re: ツイッタープラグインのアプリ認証でエラーがでます。 @ 2010/10/21 18:49
ryuringさま、いつもお世話になります。
お返事ありがとうございます。

引用:

ところで、PHPの知識はありますか?
ログを見たところ、/baser/vendors/OAuth/oauth_consumer.phpに原因があるのは間違いないようです。
createRequestメソッドや、doRequestメソッドあたりがあやしいです。


PHPはフリーで配布されているスクリプトをサーバーに設置するのがやっとの素人で、ご指摘のファイルも一応、確認してみましたが全く理解できませんでした。
残念ですが当面はツイッターの既存のブログパーツ等で間に合わせてBaserCMSの5.3系への対応を気長に待たせていただきたいと思います。

この度は、いろいろとご指導いただき本当にありがとうございます。
BaserCMSの設置後、管理画面をぼちぼちと触っていますが細かいカスタマイズがWeb上で気軽にできて、とても素晴らしいCMSだと思います。
わたしの知識ではテンプレートのカスタマイズに少し時間がかかりそうですが大事に使わせていただきます。
これからもBaserCMSの成長?を楽しみにしています。
お忙しいところ、本当にありがとうございました。
ryuring > Re: ツイッタープラグインのアプリ認証でエラーがでます。 @ 2010/10/22 5:05
pocopenwebさん

あれから、PHP5.3環境を準備してTwitterの認証テストを行ってみました。
原因がなかなか掴めずにいたのですが、状況が変わりました。

5.3の問題ではなかったです。。

先日のバージョンアップの際、コアのフレームワークである、CakePHPのバージョンアップしたのですが、
そのバージョンアップによって、セッション設定の仕様が変わっていたようで、5.3でなくても認証に失敗するという状況になってしまっていました(汗

取り急ぎ対応策です。

/app/config/core.php に次の行があります。

Configure::write('Security.level', 'medium');


この行中の、「midium」の部分の認証を行う時だけ、「low」に変更してください。

また、制作・開発モードは、「ノーマルモード」の状態で行ってください。
おそらく成功すると思います。

おかげさまでバグが発見できました。ありがとうございます。
次のバージョンアップで改善を入れたいと思います。

Twitter:@ryuring
baserCMS総合サービスサイト ビーコミ

pocopenweb > Re: ツイッタープラグインのアプリ認証でエラーがでます。 @ 2010/10/23 1:00
ryuringさま、いつもお世話になります。
早々にPHP5.3での認証テストを行っていただいて、ありがとうございます。

ご指示いただいた操作で無事にTwitterの認証が成功いたしました!
おかげさまでトップページにタイムラインの表示もできて、とても嬉しいです。
本当にありがとうございます。

今回はわたしも、ほんの少しバグの発見にご協力できたようで嬉しいです。
BaserCMSは管理画面を触れば触るほど、いろいろできて楽しいCMSだなぁと思います。
開発はとても大変だと思いますが、これからもがんばってください。
また何かありましたらこちらのフォーラムのお世話になると思いますが、どうぞよろしくお願いいたします。
ログイン
ユーザー名:
パスワード:


  新規登録 / パスワード紛失

検索

facebook
フォーラムで悩みが解決した場合など、よかったら「いいね!」をポチっとクリックしてください!質問の回答者や開発者の励みになります

フォーラムガイド


関連リンク

オンライン状況
20 人のユーザが現在オンラインです。 (19 人のユーザが フォーラム を参照しています。)

登録ユーザ: 0
ゲスト: 20