Bug 767005

Summary: Chapters with the same name are not uniquely identified
Product: [Community] PressGang CCMS Reporter: Joshua Wulf <jwulf>
Component: CSProcessorAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.xCC: jwulf, lcarlon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 0.20.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-20 01:45:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joshua Wulf 2011-12-12 23:54:20 UTC
A Chapter with the same name is not uniquely identified.

If I have a content spec with two chapters:

Chapter: Sample Chapter
  Some Content [100]

Chapter: Sample Chapter
  Different Content [110]

It looks like the second chapter overwrites the first. 

However, the problem doesn't end there..

I end up with:

Book.xml
 <xi:include href="chap-Sample-Chapter.xml">
 <xi:include href="chap-Sample-Chapter.xml">

Sample-Chapter.xml
 <xi:include href="topics/TopicID110.xml">

Which gives me an error of "ID TopicID110 is already defined", because Topic 110 is included twice in the book.

So two issues:

1. Uniquely identify chapters even when their names are the same.
2. Investigate if we can get duplicate IDs through inclusion like this through some other mechanism, and how we can detect and deal with that.

Comment 1 Joshua Wulf 2011-12-12 23:56:10 UTC
We discovered this because someone accidentally pasted the same Chapter into a Content Spec twice.

Comment 2 Lee Newson 2012-01-31 05:23:37 UTC
Fixed the Duplicate chapter naming issue. The processor never checked that chapter names were unique when processing or building. So now the builder will add the line number of the chapter to the file name. This in turn makes each chapter entity unique and allows for the book to be built by publican. The builder also takes care of the duplicate topic id because the chapters are then declared different since they have different names and therefore the topics inside are duplicated and given a unique id and filename.

As for issue number two I don't quite get what you mean by that Josh, so if you could please elaborate that'd be great.

Comment 3 Joshua Wulf 2012-01-31 05:40:09 UTC
Don't worry about the second issue. It's basically investigating to see if other inclusion mechanisms can lead to duplicate ID errors. 

If we run into it we can deal with it then.

Comment 4 Lee Newson 2012-02-03 04:18:06 UTC
Moving it onto QA then. Fixed in 0.20.0 of the csprocessor.