#1 — Use of default values in qseo_properties_edit inflexible

by Jeremy Stark last modified Dec 16, 2009 12:35 PM
State Rejected
Version: 2.1.1
Area Functionality
Issue type Bug
Severity Medium
Submitted by Jeremy Stark
Submitted on Dec 07, 2009
Responsible Andriy Mylenkyi
Target release:
Defining the parameters as follows:

##parameters=title=None,description=None,canonical=None,keywords=None,html_comment=None,robots=None,distribution=None,title_override=0,description_override=0,canonical_override=0,keywords_override=0,html_comment_override=0,robots_override=0,distribution_override=0,custommetatags=[],custommetatags_override=0

Causes problems when later the code:

setProperty(context, 'qSEO_title', title)
setProperty(context, 'qSEO_description', description)
setProperty(context, 'qSEO_keywords', keywords, 'lines')
setProperty(context, 'qSEO_html_comment', html_comment)
setProperty(context, 'qSEO_robots', robots)
setProperty(context, 'qSEO_distribution', distribution)
setProperty(context, 'qSEO_canonical', canonical)

As this will overwrite existing data if no value is supplied (and thus it is defaulted to None)

A better way of handling this might be to:

##parameters=**args

And then test for the existence of a value, setting it only when it is supplied.
Steps to reproduce:
obj.qseo_properties_edit(title='Foo', title_override=1)

elsewhere:

obj.qseo_properties_edit(description='Bar', description_override=1)

The title values are destroyed by the second call.
Added by Quintagroup on Dec 07, 2009 05:03 PM
Responsible manager: (UNASSIGNED)mylanium
Added by Andriy Mylenkyi on Dec 16, 2009 12:34 PM
Issue state: UnconfirmedRejected
Mentioned script (qseo_properties_edi.cpy) designed for work only with qseo_properties_edit_form form template, which pass all needed data to the script. Removing absent properties is designed logic.

So your request is rejected.

No responses can be added.