Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2010 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

[PATCH] Fix deprecation warning caused by using retrieve_javascrip/css with ToscaWidgets

Reported by: alexbodn Owned by: Chris Arndt
Priority: high Milestone: 1.1b2
Component: TurboGears Version: 1.1 HEAD
Severity: major Keywords: toscawidgets, needs review
Cc:

Description (last modified by Chris Arndt) (diff)

ToscaWidgets finally deprecated and disabled the retrieve_javascript and retrieve_css methods of widgets. This means that when you use tw with TurboGears 1.x, JS/CSS resources will not be injected into the page, because turbogears.controllers._process_output relies on these two methods.

TG 1.x should cope with the new situation by using the new retrieve_resources function, in addition to the older ones, still supported in Tg widgets. Additionally, hasattr should be used to check for the presence of either method.

This mailing list thread explains how to revive the older interface but with the newer infrastructure. It may help in understanding the result of retrieve_resources:

 http://www.mail-archive.com/turbogears-trunk@googlegroups.com/msg03207.html

Attachments

tw-retrieve_resources-support.diff Download (5.1 KB) - added by Chris Arndt 11 years ago.
tw-support.diff Download (11.0 KB) - added by Chris Arndt 11 years ago.
New, simpler patch with tests

Change History

comment:1 Changed 11 years ago by Chris Arndt

  • Keywords toscawidgets, needs patch added
  • Description modified (diff)
  • Type changed from defect to task
  • Severity changed from blocker to major
  • Summary changed from toscawidgets deprecated and disabled retrieve_javascript and retrieve_css to Add support for ToscaWidgets `retrieve_resources` to inject JS/CSS

Changed 11 years ago by Chris Arndt

comment:2 Changed 11 years ago by Chris Arndt

  • Status changed from new to assigned
  • Owner changed from faide to Chris Arndt
  • Keywords review added; patch removed

Added a patch to add support for ToscaWidget's retrieve_resources mechanism and debug/refactor the resources retrieval logic. Patch untested.

comment:3 Changed 11 years ago by Chris Arndt

  • Summary changed from Add support for ToscaWidgets `retrieve_resources` to inject JS/CSS to [PATCH] Add support for ToscaWidgets `retrieve_resources` to inject JS/CSS

Changed 11 years ago by Chris Arndt

New, simpler patch with tests

comment:4 Changed 11 years ago by Chris Arndt

Added a new, simpler patch with tests for inclusion of tw widgets in Genshi and Kid templates. As I found out, tw already takes care of the inclusion of JS/CSS resources, so tw widgets can be (and should be) just skipped in controllers._process_output.

Note: for some reason the attached patch doesn't display correctly in trac. Just use the "Original format" link to view/download it.

comment:5 Changed 11 years ago by faide

+1 for the new patch... I love the tests :-)

comment:6 Changed 11 years ago by Chris Arndt

  • Status changed from assigned to closed
  • Resolution set to fixed
  • Type changed from task to defect
  • Summary changed from [PATCH] Add support for ToscaWidgets `retrieve_resources` to inject JS/CSS to [PATCH] Fix deprecation warning caused by using retrieve_javascrip/css with ToscaWidgets

Applied (with minor fix to tests) in r5665.

Note: See TracTickets for help on using tickets.