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

Snippet preview and analysis results broken in PHP 7.0 #266

Closed
2 tasks done
tieupmedia opened this issue May 7, 2019 · 1 comment · Fixed by #271 or #444
Closed
2 tasks done

Snippet preview and analysis results broken in PHP 7.0 #266

tieupmedia opened this issue May 7, 2019 · 1 comment · Fixed by #271 or #444

Comments

@tieupmedia
Copy link

  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened.

In the BE analysis and snippet preview aren't working.

In the browser console, a failed xhr request returning an TYPO3 error messsage is seen:

Oops, an error occured!
syntax error, unexpected '?'

Please describe what you expected to happen and why.

Showing the snippet preview and analysis result as intended in the page module in current page overview / current page settings for yoast.

How can we reproduce this behavior?

  1. Run TYPO3 8.7.x with PHP 7.0.x
  2. Install yoast_seo 5.0.1

How can we resolve this behavior?

In Classes/UserFunctions/SnippetPreview.php the line 118 defines a nullable return value for the function getContentFromUrl().

Remove the nullable declaration or limit the extension to PHP >= 7.1, cause this feature was initial available in PHP 7.1. See https://www.php.net/manual/de/migration71.new-features.php

Btw., please general add the php dependency to ext_emconf.php, correlating to determination in composer.json.

Screenshots

If applicable, add screenshots to help explain your problem.

Logs

If applicable, add logs to help explain your problem.

Additional context

Add any other context about the problem here.

Technical info

  • TYPO3 version: 8.7.24
  • Yoast SEO version: 5.0.1
  • Relevant extensions in case of a bug:
  • PHP-Version: 7.0.x < 7.1
@haassie
Copy link
Contributor

haassie commented Jun 13, 2019

Please be aware that PHP 7.0 is end-of-life. I would really suggest to update your PHP to 7.1+. Will have a look at the patch and we will update version constraints in ext_emconf.php

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