Bug 767005 - Chapters with the same name are not uniquely identified
Summary: Chapters with the same name are not uniquely identified
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: CSProcessor
Version: 1.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Lee Newson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-12 23:54 UTC by Joshua Wulf
Modified: 2014-10-19 22:59 UTC (History)
2 users (show)

Fixed In Version: 0.20.0
Clone Of:
Environment:
Last Closed: 2013-03-20 01:45:15 UTC
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.