Skip to content

Marc\Record->getFields() fatal error on php 8.1 #27

@hrvoj3e

Description

@hrvoj3e
$xml = $this->fetchXml($identifier);
$record = Marc\Record::fromString($xml);
$fields = $record->getFields();
Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, 
File_MARC_List given in /einwww/mycode/marc21import/vendor/scriptotek/marc/src/Record.php:115 
Stack trace: #0 /einwww/mycode/marc21import/vendor/scriptotek/marc/src/Record.php(115): 
array_map() #1 /einwww/mycode/marc21import/Marc21Import.php(125): 
Scriptotek\Marc\Record->getFields() #2
php8.1 /usr/local/bin/composer  require scriptotek/marc


{
    "require": {
        "scriptotek/marc": "^3.0"
    }
}


  - Installing ck/php-marcspec (2.0.3): Extracting archive
  - Installing pear/pear_exception (v1.0.2): Extracting archive
  - Installing pear/file_marc (1.4.1): Extracting archive
  - Installing ck/file_marc_reference (v1.2.0): Extracting archive
  - Installing scriptotek/marc (v3.0.0): Extracting archive

I tried manually using "pear/file_marc": "master@dev" but it has not helped

{
    "require": {
        "scriptotek/marc": "^3.0",
        "pear/file_marc": "master@dev"
    }
}


  - Installing ck/php-marcspec (2.0.3): Extracting archive
  - Installing pear/pear_exception (v1.0.2): Extracting archive
  - Installing pear/file_marc (dev-master 7085b9e): Extracting archive
  - Installing ck/file_marc_reference (v1.2.0): Extracting archive
  - Installing scriptotek/marc (v3.0.0): Extracting archive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions