Closed Bug 635092 Opened 13 years ago Closed 13 years ago

Validation fails with a DOCTYPE in install.rdf

Categories

(addons.mozilla.org Graveyard :: Developer Pages, defect)

x86_64
Linux
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
5.12.12

People

(Reporter: elbert.foo, Assigned: basta)

References

()

Details

Attachments

(1 file)

285.48 KB, application/x-xpinstall
Details
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0b10pre) Gecko/20110113 Firefox/4.0b10pre
Build Identifier: 

When I upload a new version of my addon I get the following message:

Your add-on failed validation with 2 errors.

    Cannot Parse install.rdf
    Addon missing install.rdf.

Since I only changed the version number in the RDF file I'm pretty sure it's fine and it's definitely present.

Reproducible: Always

Steps to Reproduce:
1. Upload new version
2. Select a file
Actual Results:  
Message about missing install.rdf
Attached file Wappalyzer 1.13.0
Status: UNCONFIRMED → NEW
Ever confirmed: true
Matt, what is failing here?
Assignee: nobody → mbasta
Target Milestone: --- → 5.12.12
rdflib is choking on the install.rdf because of the DOCTYPE's chrome:// url.

Two things:
1.) This is probably a good point to break away from rdflib and either come up with a better in-house solution or start patching it. We've had other problems with rdflib before (namely that it doesn't keep line numbers around).
2.) I'd assume that the doctype should never be anything but a chrome:// url. This is something we should be testing. Since rdflib is trying to actually fetch the URL provided, that's also a problem.

Unless anyone thinks that there is a simpler/better fix, I'm going to start chipping away at this with a new library for RDF.
I just submitted the add-on without a DOCTYPE in install.rdf and that worked.
(In reply to comment #3)
> Unless anyone thinks that there is a simpler/better fix, I'm going to start
> chipping away at this with a new library for RDF.

I personally don't think this is worth spending time on. The DOCTYPE is completely unnecessary for the install.rdf file, so it should be removed anyway. I've seen this in a couple of other add-ons, so maybe it's the product of some tutorial or template.

It'd be nicer if the warning clarified what is the source of the error, but I would still consider it an error.
(In reply to comment #3)
> Unless anyone thinks that there is a simpler/better fix, I'm going to start
> chipping away at this with a new library for RDF.

if re.search('doctype', rdf.read(), re.I):
    raise VaildationError("Please remove the doctype from your install.rdf.")
Summary: Validation fails when adding new version → Validation fails with a DOCTYPE in install.rdf
For reference, this is the tutorial that shows the DOCTYPE's use, though not in an install.rdf:

http://kb.mozillazine.org/Getting_started_with_extension_development#overlay.xul

Apparently it's supposed to localize strings in an overlay. Since XUL is parsed using a its own parser, this shouldn't be an issue on that side. For install.rdf files, though, this is certainly an error. 

I'll implement something like Jeff's code after breakfast.
Done:

https://github.com/mattbasta/amo-validator/commit/17031fad54ec3dc8dc2b7c96e125be223a000464
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Depends on: 726994
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: