I've been using GRAV as a CMS for a small experimental site. I recently updated the git-sync plugin, and am suddenly stuck with a website that produces only errors, with no way to enter the admin gui (all web access to the site crashes with same errors), to downgrade the git-sync module, or for that matter, to upgrade the git-sync plugin if there is a fix.
I'm a developer that hasn't really thought much about web development in decades (my, how it's changed), so there are a few things I have to admit upfront. I don't know sht about php, and really don't care to if I don't have to.
The message I get (below) indicates that this is a php error. If this is a simple syntax fix please give me a heads up.
If you have any advice on a "cli" way to use the git-sync plugin to upgrade or downgrade, revert the git-sync, or any other hints, advise away. I'll dig in to more documentation and see if I end up answering my own question.
/[pathToUserHome]/grav/user/plugins/git-sync/classes/GitSync.php
*/
$paths = ['.'];
if (version_compare($version, '2.0', '<')) {
$add .= ' --all';
}
return $this->execute($add . ' ' . implode(' ', $paths));
}
public function commit($message = '(Grav GitSync) Automatic Commit')
{
$authorType = $this->getGitConfig('author', 'gituser');
if (defined('GRAV_CLI') && in_array($authorType, ['gravuser', 'gravfull'])) {
$authorType = 'gituser';
}
// get message from config, it any, or stick to the default one
$message = $this->getConfig('git', null)['message'] ?? $message;
// get Page Title and Route from Post
$pageTitle = $_POST['data']['header']['title']??'NO TITLE FOUND';
$pageRoute = $_POST['data']['route']??'NO ROUTE FOUND';
...
Arguments
1) "syntax error, unexpected '?'"
Whoops\Exception\ErrorException…
/user/plugins/git-sync/classes/GitSync.php : 223
$message = $this->getConfig('git', null)['message'] ?? $message;