Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#72 closed defect (released)

Omegascript $set{stem_all,true} affects $field processing

Reported by: Mike Hsu Owned by: Olly Betts
Priority: high Milestone:
Component: Omega Version: 0.9.4
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: Mac OS X

Description

When an Omegascript template contains the command $set{stem_all,true}, later references to $field{XXX} return nothing.

This appears to be caused by new "fieldnames" processing introduced in 0.9.3 The code in print_caption() in query.cc obtains an iterator to a "fieldnames" option via

opt = option.lower_bound("fieldnames");

But because there is currently no default "fieldnames" option, if there is no "fieldnames" option set in Omegascript, lower_bound will return an iterator pointing to the "stem_all" option. This is then incorrectly processed as the "fieldnames" option, and if it has a non-null value, the "field" map is never loaded.

The short-term workaround is to include a $set{fieldnames,} command in the template, if it isn't already being used for something.

Attachments (1)

omega-fieldnames.patch (1.0 KB ) - added by Olly Betts 19 years ago.
Proposed fix

Download all attachments as: .zip

Change History (5)

by Olly Betts, 19 years ago

Attachment: omega-fieldnames.patch added

Proposed fix

comment:1 by Olly Betts, 19 years ago

Status: newassigned

Yes, your analysis is spot on!

Could you try the attached patch?

comment:2 by Mike Hsu, 19 years ago

Looks good, thanks Olly!

comment:3 by Olly Betts, 19 years ago

Resolution: fixed
Status: assignedclosed

Thanks for testing.

Fixed in SVN trunk.

comment:4 by Olly Betts, 19 years ago

Operating System: Mac OS X
Resolution: fixedreleased

Fixed in 0.9.5

Note: See TracTickets for help on using tickets.