SemanticMediaWiki / SemanticCite

Allows to manage citation resources using semantic annotations
https://www.semantic-mediawiki.org/wiki/Extension:Semantic_Cite
Other
24 stars 13 forks source link

Deprecated: Array and string offset access syntax with curly braces is deprecated #103

Open kghbln opened 2 years ago

kghbln commented 2 years ago

Setup and configuration

Issue

When rebuilding data I get the following notices:

Deprecated: Array and string offset access syntax with curly braces is deprecated in /../w/extensions/SemanticCite/src/Bibtex/BibtexParser.php on line 99

Deprecated: Array and string offset access syntax with curly braces is deprecated in /../w/extensions/SemanticCite/src/Bibtex/BibtexParser.php on line 111

Deprecated: Array and string offset access syntax with curly braces is deprecated in /../w/extensions/SemanticCite/src/Bibtex/BibtexParser.php on line 140

Deprecated: Array and string offset access syntax with curly braces is deprecated in /../w/extensions/SemanticCite/src/Bibtex/BibtexParser.php on line 143

Deprecated: Array and string offset access syntax with curly braces is deprecated in /../w/extensions/SemanticCite/src/PreTextFormatter.php on line 36

Deprecated: Array and string offset access syntax with curly braces is deprecated in /../w/extensions/SemanticCite/src/PreTextFormatter.php on line 40
bescheid commented 2 years ago

Setup (just newly installed)

MW 1.35.5, SMW 3.2.3, SCI: 2.1.1. PHP: 8.0.17

Issue

Pages which use {{#scite: ...}} do not show up. Instead I get: "Fatal error: Array and string offset access syntax with curly braces is no longer supported in /var/www/html/r3/extensions/SemanticCite/src/Bibtex/BibtexParser.php on line 99"

bescheid commented 2 years ago

After manually changing the respective curly braces indicated in kghbin's post, into [$] everthing works fine.

krabina commented 1 year ago

Maybe we did not fully understand the issue here. The #scite parser function now certainly is working again. Also i do not get any error messages on running rebuildData.php

pinfold commented 1 year ago

I just ran into this issue. Can you clarify when you say "After manually changing the respective curly braces indicated in kghbin's post, into [$] everthing works fine." can you give an example? Did you change

{{#scite:Byrne 2008 |type=journal |author=Byrne, A |date=2008 |title=Web 2.0 strategies in libraries and information services |journal=The Australian Library Journal |volume=57 |number=4 |pages=365-376 |file=Web 2 0 strategy in libraries and information services.pdf }}

to

[$scite:Byrne 2008 |type=journal |author=Byrne, A |date=2008 |title=Web 2.0 strategies in libraries and information services |journal=The Australian Library Journal |volume=57 |number=4 |pages=365-376 |file=Web 2 0 strategy in libraries and information services.pdf ]

krabina commented 12 months ago

No, this will definitely not work. The curyl braces deprecation is related to the source code, not the wikitext (parser function) that you use. So it seems that @bescheid has manually corrected things in the source code, but we did not get a pull request, so we don't have this yet.

krabina commented 12 months ago

It seems this is wrong: https://github.com/SemanticMediaWiki/SemanticCite/blob/67ecb1bc233478b64bf7659977b2d0d0d22693df/src/Bibtex/BibtexParser.php#L99-L101

see https://phabricator.wikimedia.org/T231303