Opened 15 years ago

Closed 15 years ago

#1327 closed defect (fixed)

BaseFileExporter creates two parameter sections if the first plug-in parameter is 'section'

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: critical Milestone: BASE 2.12.1
Component: core Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

For example:

If a BASE1 plug-in defines the first parameter as:

1	h	section		30	cghBFCParams		0
... and more parameters

the following is generated in the exported BASEfile:

BASEfile
section	cghBFCParams
%

section	settings
... and more parameters

If the 'section' parameter is left out from the plug-in definition the file is created as expected:

BASEfile
section	settings
... and more parameters

This workaround only works if the plug-in in question doesn't care about the name of the section. Plug-ins that require the parameters section to have a specific name will not work.

Change History (3)

comment:1 by Nicklas Nordborg, 15 years ago

Description: modified (diff)
Owner: changed from everyone to Nicklas Nordborg
Status: newassigned
Summary: BaseFileExporter creates two parameter sections if the first plug-in parameter is 'section' with a value different from 'settings'BaseFileExporter creates two parameter sections if the first plug-in parameter is 'section'

Ooops... it turns out that duplicate sections are generated in all cases where the plug-in defines a 'section' parameter. It doesn't matter if the value is 'settings' or some other value. I'll change the description of the ticket.

comment:2 by Nicklas Nordborg, 15 years ago

I have found the problem. It is the 'continue' statement on line 247 in BaseFileExporter that causes the 'first=true' flag to not be set if the plug-in defines a 'section' parameter. Thus, when the second parameter is processed, the code still thinks it is the first one and starts a new section again.

We should really get rid of all places in the code that has a 'continue' statement. It is really dangerous and it is not always easy to know which line the statement jumps to...

comment:3 by Nicklas Nordborg, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [4961]) Fixes #1327: BaseFileExporter creates two parameter sections if the first plug-in parameter is 'section'

Note: See TracTickets for help on using tickets.