Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controlled Access Terms emitting PHP warnings and notices #1123

Closed
kayakr opened this issue May 20, 2019 · 4 comments
Closed

Controlled Access Terms emitting PHP warnings and notices #1123

kayakr opened this issue May 20, 2019 · 4 comments

Comments

@kayakr
Copy link
Contributor

kayakr commented May 20, 2019

e.g. EDTF Date field value of 1962 generates

  • Warning: Declaration of Drupal\controlled_access_terms\EDTFConverter::dateIso8601Value(array $data) should be compatible with Drupal\rdf\CommonDataConverter::dateIso8601Value($data) in require() (line 10 of modules/contrib/controlled_access_terms/src/EDTFConverter.php).
  • Notice: Undefined offset: 4 in Drupal\controlled_access_terms\EDTFUtils::iso8601Value() (line 336 of modules/contrib/controlled_access_terms/src/EDTFUtils.php).
  • Notice: Undefined offset: 4 in Drupal\controlled_access_terms\Plugin\Field\FieldFormatter\EDTFFormatter->formatDate() (line 209 of modules/contrib/controlled_access_terms/src/Plugin/Field/FieldFormatter/EDTFFormatter.php).
  • Notice: Undefined offset: 4 in Drupal\controlled_access_terms\Plugin\Field\FieldFormatter\EDTFFormatter->formatDate() (line 209 of modules/contrib/controlled_access_terms/src/Plugin/Field/FieldFormatter/EDTFFormatter.php).
@kayakr
Copy link
Contributor Author

kayakr commented May 20, 2019

I've offered a PR at Islandora/controlled_access_terms#27 to remove the array type hint that conflicts with CommonDataConverter parent class.

@kayakr
Copy link
Contributor Author

kayakr commented May 20, 2019

Regarding the PHP notice for line 336 in EDTFUtils.php, iso8601Value() receives $edtf="1962" and $parsed_date=

(
    [0] => 1962
    [1] => 
    [2] => 1962
    [3] => 1962
)

There is no value at $parsed_date[EDTFUtils::YEAR_EXPONENT] where YEAR_EXPONENT is set to 4.

@seth-shaw-unlv
Copy link
Contributor

@kayakr, thanks for making an issue for these. I've kept kicking them down the road, but I'll see if I can address some of them this week (unless you beat me to it).

@seth-shaw-unlv
Copy link
Contributor

Resolved by Islandora/controlled_access_terms/pull/28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants