Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
ParseError: syntax error, unexpected ')', expecting ']' in Composer\Autoload\includeFile() (line 59 of /srv/bindings/3cca46d015ae47d6b58244cc3eb7e992/code/docroot/modules/contrib/schema_metatag/src/Plugin/metatag/Tag/SchemaSpeakableTrait.php) #0
https://git.drupalcode.org/project/schema_metatag/blob/8.x-1.x/src/Plugi...
Currently:
$form['xpath'] = [
'#type' => 'textfield',
'#title' => $this->t('xpath'),
'#default_value' => !empty($value['xpath']) ? $value['xpath'] : '',
'#description' => $this->t('ex: @example',
['@example' => "'/html/head/title'", "'/html/head/meta[@name=\'description\']/@content']'"),
];
Needs to be:
$form['xpath'] = [
'#type' => 'textfield',
'#title' => $this->t('xpath'),
'#default_value' => !empty($value['xpath']) ? $value['xpath'] : '',
'#description' => $this->t('ex: @example',
['@example' => "'/html/head/title'", "'/html/head/meta[@name=\'description\']/@content']'"]
),
];
Comment | File | Size | Author |
---|---|---|---|
#12 | interdiff-3068796-10-12.txt | 1.11 KB | mbovan |
#12 | fatal_php_syntax_err-3068796-12.patch | 1.19 KB | mbovan |
| |||
#10 | 3068796-9-on-top-1.4-release.patch | 1.18 KB | mbovan |
#9 | 3068796-9-5-interdiff.txt | 1.03 KB | mbovan |
#9 | 3068796-9.patch | 1.19 KB | mbovan |
|
Comments
Comment #2
davidburnsThis patch should fix that error.
Comment #3
davidburnsStill a couple other syntax errors. No fatal, but really slows down page load times if not fixed.
Comment #4
jhedstromThis indeed resolves the fatal error.
Comment #5
apaderno(This is the patch written by mpdonadio in #3078595: Fix typo / syntax error in SchemaSpeakableTrait; credits go to him for writing it.)
Comment #6
pobster CreditAttribution: pobster at ArcadeGeek LTD for Rackspace commentedThank you @kiamlaluno, this is better than the original patch which had parameter issues.
Comment #7
Martijn de Witkill two birds with one stone, nice.
Tested patch and works great.
Comment #8
mbovan CreditAttribution: mbovan at MD Systems GmbH commented#5 works fine.
Comment #9
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedI am attaching a patch that brings back space between examples added in #3 and removed in #5.
Comment #10
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedThis is the same patch as #9 made on top of Schema Metatag 8.x-1.4 release.
Comment #11
apadernoex is wrong because it's written at the start of a sentence. The correct sentence should be Separate xpaths by a comma, as in […].
I am not sure it should be XPATHs or xpaths, but I would keep that consistent with what other strings in the module use.
Comment #12
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedThanks for the review @kiamlaluno. Addressed #11.
Comment #13
BerdirThanks.
Comment #14
edwardchiapetConfirmed that the updated patch in #12 works great.
Comment #15
idimopoulos CreditAttribution: idimopoulos at Randstad Digital for European Commission and European Union Institutions, Agencies and Bodies commented+1. Can we get this in?
Comment #16
claudiu.cristeaThis breaks tests in other issues. Promoting ro Critical.
Comment #17
IT-Cru+1. Would be nice to get this into 8.x-1.x-dev to fix broken testing for new/other issues.
Comment #18
Luke.Leber+1 from me.
Applying this patch allows drupal-check to run successfully (and indicates that this module is most likely Drupal 9 compatible if the info.yml file is tweaked appropriately).
Comment #20
KarenS CreditAttribution: KarenS commentedSorry for the long delay in getting this in. Fixed. Thanks everyone!