export slices as HTML+CSS fails

Bug #1198826 reported by Ben Cottrell
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
su_v

Bug Description

This bug was encountered from the following menus:
Extensions->Web->Slicer->Export layout pieces and HTML+CSS code...

When the extension runs, it returns the following message:

Traceback (most recent call last):
 File "webslicer_export.py", line 437, in <module>
e.affect()
File "C:\Program Files (x86)\Inkscape\share\extensions\inkex.py", line 215, in affect
self.effect()
File "webslicer_export.py", line 119, in effect
error = self.validate_inputs()
File "webslicer_export.py", line 75, in validate_inputs
self.unique_html_id( self.get_slicer_layer() )
File "webslicer_export.py", line 96, in unique_html_id
for child in el.getchildren():
AttributeError: 'NoneType' object has no attribute 'getchildren'

Related branches

su_v (suv-lp)
tags: added: extensions-plugins
Revision history for this message
su_v (suv-lp) wrote :

Reproduced with Inkscape 0.48.4 and 0.48+devel r12419 on OS X 10.7.5 if trying to export without having defined any slicer rectangles in the current document (or more precisely: reproduced if the layer 'Web Slicer' is missing in the current document - export fails silently if the layer is present but empty).

Catching the error and returning a message explaining to the user to first create at least one slicer rectangle before applying 'Web > Slicer > Export layout pieces and HTML+CSS code' would be more user-friendly.

Basic description of the features of the extension:
<http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Extensions-Web.html#Extensions-Web-Slicer>

Changed in inkscape:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

Proposed fix: return error message instead of failing with AttributeError if the user attempts to export a drawing which has not been set up for export yet.

Revision history for this message
jazzynico (jazzynico) wrote :

Patch tested successfully on Windows XP, Inkscape trunk rev. 14206.

Changed in inkscape:
assignee: nobody → ~suv (suv-lp)
milestone: none → 0.92
status: Confirmed → In Progress
tags: added: backport-proposed
Revision history for this message
su_v (suv-lp) wrote :

Patch committed to trunk in rev 14216.

Changed in inkscape:
status: In Progress → Fix Committed
Revision history for this message
su_v (suv-lp) wrote :

On 2015-06-22 17:04 (+0200), jazzynico wrote:
> ** Tags added: backport-proposed

The diff has a new string marked for translation - backport to 0.91.x nevertheless?

Revision history for this message
jazzynico (jazzynico) wrote :

> The diff has a new string marked for translation - backport to 0.91.x nevertheless?

The new message doesn't affect the main UI (tools, menus...) and is far more informative than the python error message. Thus I'd say yes, it can be backported to 0.91.x.

Revision history for this message
su_v (suv-lp) wrote :

Patch committed to 0.91.x in rev 13775.

tags: removed: backport-proposed
Changed in inkscape:
milestone: 0.92 → 0.91.1
jazzynico (jazzynico)
Changed in inkscape:
milestone: 0.91.1 → 0.92
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.