Quote:
Originally Posted by ownedbycats
Thanks
Any ideas why the second part of this template isn't removing the URIs?
Attachment 186872
Code:
program:
publisher = $publisher;
ids = $identifiers;
u = select(ids, 'uri');
g = select(ids, 'gutenberg');
if publisher == 'Project Gutenberg' && u != g then
n = re(u, '^http://www.gutenberg.org/(\d+)', '\1');
ids = list_union(ids, strcat('gutenberg:', n), ',')
fi;
if publisher == 'Project Gutenberg' && u && g then
ids = list_difference(ids, strcat('uri:', u), ',')
fi;
ids
|
Are you certain that the conditions in the second 'if' are all True, that both 'ids' are set when the template starts? Run it using breakpoints to check (and record) the values.
Also, both conditions check for "publisher == 'Project Gutenberg'". You could test that once and put the other tests as nested ifs.