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

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

Open
kghbln opened this issue Nov 2, 2021 · 6 comments
Labels

Comments

@kghbln
Copy link
Member

kghbln commented Nov 2, 2021

Setup and configuration

  • SMW version: 3.2.3
  • SCI version: 2.1.1
  • MW version: 1.35.4
  • DB (MySQL etc. and version): 8.0.15

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
@kghbln kghbln added the bug label Nov 2, 2021
@bescheid
Copy link

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
Copy link

bescheid commented Mar 19, 2022

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

@krabina krabina mentioned this issue Sep 16, 2022
2 tasks
@krabina
Copy link
Contributor

krabina commented Nov 11, 2022

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
Copy link

pinfold commented Aug 21, 2023

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
Copy link
Contributor

krabina commented Sep 4, 2023

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
Copy link
Contributor

krabina commented Sep 4, 2023

It seems this is wrong:

if( $rev[0] != ',') {
$content .= ',';
}

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

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

No branches or pull requests

4 participants