<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Interesting...<br>
You could try adding the subject back into the tree temporarily to see if it works that way?<br>
<br>
Using this script should cause any affected EPrints' summary pages to be regenerated - if you alter the database directly, you'd have to do this by running bin/generate_abstracts.<br>
<br>
Cheers,<br>
John<br>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> eprints-tech-bounces@ecs.soton.ac.uk &lt;eprints-tech-bounces@ecs.soton.ac.uk&gt; on behalf of Monica Wood &lt;monica.wood@utas.edu.au&gt;<br>
<b>Sent:</b> 09 March 2016 04:33:34<br>
<b>To:</b> 'eprints-tech@ecs.soton.ac.uk'<br>
<b>Subject:</b> Re: [EP-tech] subject dataset - removing subjectid from eprint</font>
<div>&nbsp;</div>
</div>
<div>
<div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
Hi John,</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
Thanks for linking me to this script.</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
Iíve had a look through it and tried it out, but itís not working. I believe this is because Iíve already removed the node from the subject tree (Unlinked it from the tree).</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
Putting the noise level up on the script to 3 gives me some feedback on a query itís doing at I believe this line?</div>
<div>
<pre class="de1" style="color: rgb(0, 0, 0); font-size: 14px;"><font face="Courier"><span class="kw1">my</span> <span class="re0">$list</span> <span class="sy0">=</span> <span class="re0">$session</span><span class="sy0">-&gt;</span><span class="me1">get_repository</span><span class="sy0">-&gt;</span><span class="me1">dataset</span><span class="br0">(</span> <span class="st_h">'eprint'</span> <span class="br0">)</span><span class="sy0">-&gt;</span><span class="me1">search</span><span class="br0">(</span> filters <span class="sy0">=&gt;</span> <span class="br0">[</span>
        <span class="br0">{</span> meta_fields <span class="sy0">=&gt;</span> <span class="br0">[</span> <span class="re0">$fieldname</span> <span class="br0">]</span><span class="sy0">,</span>
          value <span class="sy0">=&gt;</span> <span class="re0">$subjectid</span> <span class="br0">}</span></font></pre>
<pre class="de1"><span class="br0" style="color: rgb(0, 0, 0); font-size: 14px;"><font face="Calibri">This query is (with </font></span><font face="Calibri">filename set to collections and subjectid set to theses)</font></pre>
<pre class="de1"><span style="font-size: 14px;"><font face="Courier">Database execute debug: SELECT `eprint`.`eprintid` FROM `eprint`, `eprint_collections` AS `eprint_collections`, `subject_ancestors` AS `127395456subject_ancestors` WHERE `eprint`.`eprintid`=`eprint_collections`.`eprintid` AND `eprint_collections`.`collections`=`127395456subject_ancestors`.`subjectid` AND `127395456subject_ancestors`.`ancestors` = 'theses' GROUP BY `eprint`.`printed`</font></span></pre>
<pre class="de1"><font face="Calibri">This is returning an empty list, as the theses subjectid no longer exists in subject_ancestors, but it does still exist in eprint_collections.</font></pre>
<pre class="de1"><font face="Calibri">Iíll have a go at bulk changing the records from the GUI, if that doesnít work out, Iíll do a bulk change directly in the database by removing the entries in eprint_collections that point to the theses subjectid.</font></pre>
<pre class="de1"><font face="Calibri">Cheers,</font></pre>
<pre class="de1"><b style="font-size: 12px; font-family: Arial; color: rgb(58, 58, 58);">Monica Wood</b></pre>
</div>
<div style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<p style="color: rgb(58, 58, 58); margin: 0px 0px 15px; line-height: 1.5; background-color: rgb(249, 249, 249);">
<font face="Arial"><span style="font-size: 10px;">Library Systems Officer<br>
Library |&nbsp;Division of Students &amp; Education<br>
University of Tasmania<br>
Locked Bag 25<br>
Hobart 7001<br>
T &#43;61 3 6226 1849<br>
http://www.utas.edu.au/library</span></font></p>
</div>
</div>
<span id="OLK_SRC_BODY_SECTION" style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>&lt;<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a>&gt; on behalf of John Salter &lt;<a href="mailto:J.Salter@leeds.ac.uk">J.Salter@leeds.ac.uk</a>&gt;<br>
<span style="font-weight:bold">Reply-To: </span>&quot;<a href="mailto:'eprints-tech@ecs.soton.ac.uk">'eprints-tech@ecs.soton.ac.uk</a>'&quot; &lt;<a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Tuesday, 8 March 2016 at 10:06 PM<br>
<span style="font-weight:bold">To: </span>&quot;<a href="mailto:'eprints-tech@ecs.soton.ac.uk">'eprints-tech@ecs.soton.ac.uk</a>'&quot; &lt;<a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a>&gt;<br>
<span style="font-weight:bold">Subject: </span>Re: [EP-tech] subject dataset - remove_field<br>
</div>
<div><br>
</div>
<div xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi Monica,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">I think your suggestion will remove the field itself, rather than a specific value stored in that field.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Iíve done something similar Ė just added it to the wiki for you:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="https://wiki.eprints.org/w/Remove_subjectid_script">https://wiki.eprints.org/w/Remove_subjectid_script</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Let me know if it doesnít work for you.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">John<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">
<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a> [<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">mailto:eprints-tech-bounces@ecs.soton.ac.uk</a>]
<b>On Behalf Of </b>Monica Wood<br>
<b>Sent:</b> 08 March 2016 06:17<br>
<b>To:</b> <a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a><br>
<b>Subject:</b> [EP-tech] subject dataset - remove_field<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Hi there,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">In our repository we have a root subject called ĎCollectionsí &nbsp;Under this I have unlinked(deleted) a child of Collections.&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">I now have the issue that all items that were connected to this collection still have the metadata saying so and on our summary page we display the collection an
 item belongs to.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">So itís now showing Ď??colllectionName??í as a link and that link is now dead.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Is there a way to delete these connections without needing to do it directly through the database?&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">I was wondering if the epadmin remove_field might do the job on the subject dataset?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Something like:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">~/bin/epadmin remove_field repoid subject collectionid ??<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black">Thanks in advanced<o:p></o:p></span></p>
</div>
<div>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:11.25pt;margin-left:0cm;background:#F9F9F9">
<b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;color:#3A3A3A">Monica Wood</span></b><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:#3A3A3A"><br>
</span><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#3A3A3A">Library Systems Officer<br>
Library |&nbsp;Division of Students &amp; Education<br>
University of Tasmania<br>
Locked Bag 25<br>
Hobart 7001<br>
T &#43;61 3 6226 1849<br>
</span><a href="http://www.utas.edu.au/library"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">http://www.utas.edu.au/library</span></a><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:#3A3A3A"><o:p></o:p></span></p>
<p class="MsoNormal"><u><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,sans-serif;color:black">Available Times</span></u><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:black">Tues: 9am&nbsp;Ė&nbsp;5pm</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:black">Wed: 1pm&nbsp;Ė 5pm</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:black">Fri: 9am&nbsp;Ė 5pm</span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
</div>
<p style="line-height:10.0pt"><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:black"><br>
<br>
University of Tasmania Electronic Communications Policy (December, 2014). <br>
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained
 in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
<o:p></o:p></span></p>
</div>
</div>
</div>
</span></div>
</body>
</html>