<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=File_MARC</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/21246" />
      <rdf:li rdf:resource="http://pear.php.net/bug/21235" />
      <rdf:li rdf:resource="http://pear.php.net/bug/21219" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/21246">
      <title>File_MARC: Bug 21246 [Analyzed] File_MARC_Data_Field::deleteSubfield does not work as expected</title>
      <link>http://pear.php.net/bugs/21246</link>
      <content:encoded><![CDATA[<pre>File_MARC Bug
Reported by danmichaelo
2017-10-08T21:40:54+00:00
PHP: 5.6.31 OS: macOS 10.13 Package Version: 1.1.5

Description:
------------
Removing multiple subfields using deleteSubfield does not work as expected. 
The problem is that the method doesn't call $n-&gt;setPosition($pos) on the 
subfields that follow the removed field. I wasn't familiar with the 
SplDoublyLinkedList structure from before, but I tried cooking together a 
patch that at least solves my issue.

Test script:
---------------
require 'vendor/autoload.php';
require 'File/MARC/Data_Field.php';

$field = new File_MARC_Data_Field(650, [
        new File_MARC_Subfield('9', 'test1'),
        new File_MARC_Subfield('9', 'test2'),
        new File_MARC_Subfield('0', 'test3'),
        new File_MARC_Subfield('9', 'test4'),
]);

echo &quot;--- Before: ---\n$field\n\n&quot;;

foreach ($field-&gt;getSubfields('9') as $subfield) {
        echo &quot;Deleting subfield: $subfield\n&quot;;
        $field-&gt;deleteSubfield($subfield);
}

echo &quot;\n--- After: ---\n$field\n\n&quot;;

Expected result:
----------------
--- Before: ---
650    _9test1
       _9test2
       _0test3
       _9test4

Deleting subfield: [9]: test1
Deleting subfield: [9]: test2
Deleting subfield: [9]: test4

--- After: ---
650    _0test3


Actual result:
--------------
--- Before: ---
650    _9test1
       _9test2
       _0test3
       _9test4

Deleting subfield: [9]: test1
Deleting subfield: [9]: test2
Deleting subfield: [9]: test4

--- After: ---
650    _9test2
       _9test4</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_MARC Bug
Reported by danmichaelo
2017-10-08T21:40:54+00:00
PHP: 5.6.31 OS: macOS 10.13 Package Version: 1.1.5

Description:
------------
Removing multiple subfields using deleteSubfield does not work as expected. 
The problem is that the method doesn't call $n-&gt;setPosition($pos) on the 
subfields that follow the removed field. I wasn't familiar with the 
SplDoublyLinkedList structure from before, but I tried cooking together a 
patch that at least solves my issue.

Test script:
---------------
require 'vendor/autoload.php';
require 'File/MARC/Data_Field.php';

$field = new File_MARC_Data_Field(650, [
        new File_MARC_Subfield('9', 'test1'),
        new File_MARC_Subfield('9', 'test2'),
        new File_MARC_Subfield('0', 'test3'),
        new File_MARC_Subfield('9', 'test4'),
]);

echo &quot;--- Before: ---\n$field\n\n&quot;;

foreach ($field-&gt;getSubfields('9') as $subfield) {
        echo &quot;Deleting subfield: $subfield\n&quot;;
        $field-&gt;deleteSubfield($subfield);
}

echo &quot;\n--- After: ---\n$field\n\n&quot;;

Expected result:
----------------
--- Before: ---
650    _9test1
       _9test2
       _0test3
       _9test4

Deleting subfield: [9]: test1
Deleting subfield: [9]: test2
Deleting subfield: [9]: test4

--- After: ---
650    _0test3


Actual result:
--------------
--- Before: ---
650    _9test1
       _9test2
       _0test3
       _9test4

Deleting subfield: [9]: test1
Deleting subfield: [9]: test2
Deleting subfield: [9]: test4

--- After: ---
650    _9test2
       _9test4</pre>]]></description>
      <dc:date>2017-12-04T09:55:30+00:00</dc:date>
      <dc:creator>danmichaelo &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>File_MARC Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/21235">
      <title>File_MARC: Bug 21235 [Open] toXML arguments dont make sense</title>
      <link>http://pear.php.net/bugs/21235</link>
      <content:encoded><![CDATA[<pre>File_MARC Bug
Reported by surfrdan
2017-08-18T11:24:56+00:00
PHP: 5.5.38 OS:  Package Version: 1.1.5

Description:
------------
in the toXML() function within MARC/Record.php it strikes me that 
the argument $single should return a MARCXML document without 
the collection element but the reverse is true. Is this expected?</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_MARC Bug
Reported by surfrdan
2017-08-18T11:24:56+00:00
PHP: 5.5.38 OS:  Package Version: 1.1.5

Description:
------------
in the toXML() function within MARC/Record.php it strikes me that 
the argument $single should return a MARCXML document without 
the collection element but the reverse is true. Is this expected?</pre>]]></description>
      <dc:date>2017-08-18T11:24:56+00:00</dc:date>
      <dc:creator>dof &amp;#x61;&amp;#116; llgc &amp;#x64;&amp;#111;&amp;#x74; org &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>File_MARC Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/21219">
      <title>File_MARC: Bug 21219 [Open] toXML method modifies the MARC leader</title>
      <link>http://pear.php.net/bugs/21219</link>
      <content:encoded><![CDATA[<pre>File_MARC Bug
Reported by aroussos
2017-06-15T19:01:37+00:00
PHP: 5.6.30 OS: Debian (jessie) Package Version: 1.1.5

Description:
------------
We recently discovered that a number of authority records in our Koha ILS installation have the following glitch: an extra space character (&quot; &quot;) appears at the end of the MARC leader. I wrote a simple script that uses PHP's rtrim() to remove the trailing whitespace, however the toXML() call at the end of my script appears to modify the leader by inserting the string &quot;na&quot; at positions 05 and 06. Is this intentional?

Test script:
---------------
As per the bug submission guidelines, my test script is longer than 20 lines of code, so here's a link to it:
https://pastebin.com/GbqVWdcb

Expected result:
----------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;collection xmlns=&quot;http://www.loc.gov/MARC21/slim&quot;&gt;
 &lt;record&gt;
  &lt;leader&gt;00143     2200073   4500&lt;/leader&gt;
  &lt;controlfield tag=&quot;001&quot;&gt;260&lt;/controlfield&gt;
  &lt;datafield tag=&quot;100&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
   &lt;subfield code=&quot;a&quot;&gt;20120402afrey50      ba0&lt;/subfield&gt;
  &lt;/datafield&gt;
  &lt;datafield tag=&quot;152&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
   &lt;subfield code=&quot;b&quot;&gt;PERSO_NAME&lt;/subfield&gt;
  &lt;/datafield&gt;
  &lt;datafield tag=&quot;200&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
   &lt;subfield code=&quot;a&quot;&gt;Severin&lt;/subfield&gt;
   &lt;subfield code=&quot;b&quot;&gt;Georgii&lt;/subfield&gt;
  &lt;/datafield&gt;
 &lt;/record&gt;
&lt;/collection&gt;

Actual result:
--------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;collection xmlns=&quot;http://www.loc.gov/MARC21/slim&quot;&gt;
 &lt;record&gt;
  &lt;leader&gt;00143na   2200073   4500&lt;/leader&gt;
  &lt;controlfield tag=&quot;001&quot;&gt;260&lt;/controlfield&gt;
  &lt;datafield tag=&quot;100&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
   &lt;subfield code=&quot;a&quot;&gt;20120402afrey50      ba0&lt;/subfield&gt;
  &lt;/datafield&gt;
  &lt;datafield tag=&quot;152&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
   &lt;subfield code=&quot;b&quot;&gt;PERSO_NAME&lt;/subfield&gt;
  &lt;/datafield&gt;
  &lt;datafield tag=&quot;200&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
   &lt;subfield code=&quot;a&quot;&gt;Severin&lt;/subfield&gt;
   &lt;subfield code=&quot;b&quot;&gt;Georgii&lt;/subfield&gt;
  &lt;/datafield&gt;
 &lt;/record&gt;
&lt;/collection&gt;</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_MARC Bug
Reported by aroussos
2017-06-15T19:01:37+00:00
PHP: 5.6.30 OS: Debian (jessie) Package Version: 1.1.5

Description:
------------
We recently discovered that a number of authority records in our Koha ILS installation have the following glitch: an extra space character (&quot; &quot;) appears at the end of the MARC leader. I wrote a simple script that uses PHP's rtrim() to remove the trailing whitespace, however the toXML() call at the end of my script appears to modify the leader by inserting the string &quot;na&quot; at positions 05 and 06. Is this intentional?

Test script:
---------------
As per the bug submission guidelines, my test script is longer than 20 lines of code, so here's a link to it:
https://pastebin.com/GbqVWdcb

Expected result:
----------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;collection xmlns=&quot;http://www.loc.gov/MARC21/slim&quot;&gt;
 &lt;record&gt;
  &lt;leader&gt;00143     2200073   4500&lt;/leader&gt;
  &lt;controlfield tag=&quot;001&quot;&gt;260&lt;/controlfield&gt;
  &lt;datafield tag=&quot;100&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
   &lt;subfield code=&quot;a&quot;&gt;20120402afrey50      ba0&lt;/subfield&gt;
  &lt;/datafield&gt;
  &lt;datafield tag=&quot;152&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
   &lt;subfield code=&quot;b&quot;&gt;PERSO_NAME&lt;/subfield&gt;
  &lt;/datafield&gt;
  &lt;datafield tag=&quot;200&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
   &lt;subfield code=&quot;a&quot;&gt;Severin&lt;/subfield&gt;
   &lt;subfield code=&quot;b&quot;&gt;Georgii&lt;/subfield&gt;
  &lt;/datafield&gt;
 &lt;/record&gt;
&lt;/collection&gt;

Actual result:
--------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;collection xmlns=&quot;http://www.loc.gov/MARC21/slim&quot;&gt;
 &lt;record&gt;
  &lt;leader&gt;00143na   2200073   4500&lt;/leader&gt;
  &lt;controlfield tag=&quot;001&quot;&gt;260&lt;/controlfield&gt;
  &lt;datafield tag=&quot;100&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
   &lt;subfield code=&quot;a&quot;&gt;20120402afrey50      ba0&lt;/subfield&gt;
  &lt;/datafield&gt;
  &lt;datafield tag=&quot;152&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
   &lt;subfield code=&quot;b&quot;&gt;PERSO_NAME&lt;/subfield&gt;
  &lt;/datafield&gt;
  &lt;datafield tag=&quot;200&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
   &lt;subfield code=&quot;a&quot;&gt;Severin&lt;/subfield&gt;
   &lt;subfield code=&quot;b&quot;&gt;Georgii&lt;/subfield&gt;
  &lt;/datafield&gt;
 &lt;/record&gt;
&lt;/collection&gt;</pre>]]></description>
      <dc:date>2017-06-16T13:45:50+00:00</dc:date>
      <dc:creator>arouss1980 &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>File_MARC Bug</dc:subject>
    </item>
</rdf:RDF>
