Processed hundreds of images for the Volume 11 collection. I predict that I will complete the processing of the remainder by next Monday afternoon. I am at 383 of 433 original images, presently.
Leaving early.
I've made some significant progress with this, but now I'm getting down to the parts where I have obsolete properties entangled with similar live properties in method signatures and code blocks. I've managed to eliminate three of the four obsolete properties from MdhRecordList: $isEmbedded, $parentId, and $parentIdField. These are hardly used at all by other classes, so eliminating them was simply a local issue, with a few exceptions.
The remaining property is $parentSuffix, and this is problematic because it's passed to any child MdhRecord objects, and referenced throughout the code of both classes, although I don't believe it's actually used at all any more. This is what I believe to be the case, after my first reading of the code and comments:
- I don't believe any of the current code makes use of the
MdhRecordList::parentSuffixproperty at all; it's set to an empty string and never changed. - However, it is invoked in many locations in the code. Where it occurs in direct functions writing out XHTML, I believe it could simply be eliminated.
- It is also passed to any child
MdhRecordobjects, where it is assigned toMdhRecord::parentSuffix. Inside theMdhRecordclass this is frequently invoked. Generally it is chained together withMdhRecord::localSuffix, a property which is used, and is essential, to ensure that individual forms and form elements have uniqueidattributes. - The Adaptive Fields library
adaptive_fields.phpuses a property with the same name, but I don't believe there's any direct connection between the two. - When
MdhRecorduses a suffix, it's usually done by calling itsgetSuffix()method, which chains togetherparentSuffixandlocalSuffix. In current usage, since theparentSuffixis always set to an empty string, I believe only thelocalSuffixis ever written out.
Given this, I think this might be a suitably cautious approach to eliminating this complication:
- Start with
MdhRecordList, and ensure that nothing can set the value of$parentSuffixto anything except an empty string. Test thoroughly. - Next, move to
MdhRecord, and ensure that nothing can set its$parentSuffixto anything but an empty string. Test again. - If all is well, eliminate all uses of
$parentSuffixfromMdhRecordListand test again. This will leave the class making calls toMdhRecordmethods where it supplies an empty string in place of its$parentSuffix. - Identify those methods in
MdhRecord, and refactor them so that they don't require that parameter; then remove it from all calls to the methods. Test very thoroughly. - Remove all remaining code from
MdhRecordListwhich references$parentSuffix, and test again. - Remove all code referencing
$parentSuffixfromMdhRecord, and test again. - Examine
gui.js. This has functions which look for the parent suffix and use it (although I believe it's always an empty string) to build ids for form elements and querystring parameters. Remove all references to it, and test again. - Look at get_rec.php and save_rec.php to see if mentions of suffixes and ids therecan now be simplified.
- Test test test test...
Some issues still outstanding pending responses from JT. Noticed that the absence of a comma in the @reg attribute of an author's name triggers slightly different behaviour when rendering to PDF -- we need to watch out for this!
JJ reported that in some segments of the map, only a few stars were appearing. Checked the code quickly and it seemed fine, so then replaced the index1.xml file with a backup copy from May and the start reappeared. Compared May index1.xml to September index1.xml and noted differences.
Concluded that the code processing that XML file into stars for the map requires that if you specify a segment on the map in the section/title and section/sortKey elements (e.g. A6) then you must specify a shape (rect or poly) and provide coordinates (a minimum of four numbers, I'm not quite sure what each number represents, though they are obviously the number of pixels from the top-left corner of the image).
If you write a location element like this:
<location>
<title>The Curtain</title>
<sortKey>CURTAIN</sortKey>
<id>CURT2</id>
<type>site</type>
<section>
<title>A6</title>
<sortKey>A6</sortKey>
<shape/>
<coords/>
</section>
</location>
then a star for that entry doesn't appear, and some other stars in that segment of the map (e.g. A6) don't appear either (the code processing the stars for the map segment dies when it encounters the empty shape element and any subsequent entries aren't processed into stars)
If you include an entry like this:
<location>
<title>The Curtain</title>
<sortKey>CURTAIN</sortKey>
<id>CURT2</id>
<type>site</type>
<section>
<title>A6</title>
<sortKey>A6</sortKey>
<shape>rect</shape>
<coords/>
</section>
</location>
then a star for this entry appears on the left margin immediately below the map, and the stars for all the other entries appear properly. If you have more than one such entry in a section, then all of the stars for such entries are piled underneath each other and only the first star is visible. The rect requires at least 4 comma-delimited integers which are offsets from the top-left of the image (but I'm not sure of exactly what each value represents)
If the location has a sortKey value of OFF MAP, then apparently there are no problem with the display.
Continuing comments on contentious tickets, and three new tickets to vote on.
Added new sponsor on JS-R's instructions.