ビューレットの問題を無効にすることがよくありますが、それがうまくいかない理由が見つからないことがよくあります。ブラウザレイヤーを使用してPloneでビューレットの作成をデバッグする方法
私は今、browserlayerを使用するがplone.app.layout.viewlets.common.BaseViewletから継承しないcollective.googleanalyticsトラッカービューレットをオーバーライドしようとしています。
これを達成するために、私はc.googleanalyticsを継承するブラウザ層を作成し、それを登録し、永遠にうまくいっていることを確認しました。
私の代わりにc.googleanalyticsビューレットが使用されている理由はまだ分かりません。
コードはここにある:https://github.com/toutpt/collective.linguaanalytics
私はこれをデバッグするためにPDBを追加することができる場所を知ってできるようにしたいと思います。またはどのツールが役立つか
編集:
(Pdb) self.request.__provides__.__iro__
InterfaceClass plonetheme.sunburst.browser.interfaces.IThemeSpecific>,
InterfaceClass plone.app.z3cform.interfaces.IPloneFormLayer>,
InterfaceClass z3c.form.interfaces.IFormLayer>,
InterfaceClass plone.app.discussion.interfaces.IDiscussionLayer>,
InterfaceClass collective.linguaanalytics.interfaces.ILayer>,
InterfaceClass collective.googleanalytics.interfaces.browserlayer.IAnalyticsLayer>, InterfaceClass plone.theme.interfaces.IDefaultPloneLayer>,
InterfaceClass Products.CMFDefault.interfaces.ICMFDefaultSkin>,
InterfaceClass zope.publisher.interfaces.browser.IDefaultBrowserLayer>,
InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest>,
InterfaceClass zope.publisher.interfaces.http.IHTTPRequest>,
InterfaceClass zope.publisher.interfaces.IRequest>,
InterfaceClass zope.publisher.interfaces.IPublisherRequest>,
InterfaceClass zope.publisher.interfaces.IPublicationRequest>,
InterfaceClass zope.security.interfaces.IParticipation>,
InterfaceClass zope.publisher.interfaces.IApplicationRequest>,
InterfaceClass zope.interface.common.mapping.IEnumerableMapping>,
InterfaceClass zope.interface.common.mapping.IReadMapping>,
InterfaceClass zope.interface.common.mapping.IItemMapping>,
InterfaceClass zope.publisher.interfaces.ISkinnable>,
InterfaceClass zope.annotation.interfaces.IAttributeAnnotatable>,
InterfaceClass zope.annotation.interfaces.IAnnotatable>,
InterfaceClass zope.interface.Interface>)
編集: 彼らがplone.browserlayer内の他の層ごとのオーバーライド周りにテストされていないようです。バグかもしれない?
これは奇妙です。 ILayerでIAnalyticsLayerを拡張するため、コードが正しいように見えます。ちょっと怪しげに見えるのは、GSプロファイルの "analytics"ブラウザレイヤーを削除したときだけです。 – vangheem
リクエストを得ることができるところであれば、どこにでもpdbを貼り付け、リクエスト__が__.__ iro__の出力を提供したことをお知らせください。 –
@vangheem分析層を削除することがテストでした。私はこれをせずにプッシュしました。 – toutpt