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

PHP errors #766

Open
ccharacter opened this issue Jun 24, 2024 · 27 comments
Open

PHP errors #766

ccharacter opened this issue Jun 24, 2024 · 27 comments
Assignees
Labels

Comments

@ccharacter
Copy link

Version of ALPS for Wordpress
v3

Describe the bug
ERROR LOGS:
[24-Jun-2024 15:25:52 UTC] PHP Deprecated: Creation of dynamic property Roots\Acorn\Sage\Sage::$files is deprecated in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/Sage/Sage.php on line 65 [24-Jun-2024 15:26:56 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 67 [24-Jun-2024 15:26:56 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 75 [24-Jun-2024 15:26:56 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 114 [24-Jun-2024 15:26:56 UTC] PHP Deprecated: Creation of dynamic property Roots\Acorn\Sage\Sage::$files is deprecated in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/Sage/Sage.php on line 65 [24-Jun-2024 15:26:57 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 67 [24-Jun-2024 15:26:57 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 75 [24-Jun-2024 15:26:57 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/PackageManifest.php on line 114 [24-Jun-2024 15:26:57 UTC] PHP Deprecated: Creation of dynamic property Roots\Acorn\Sage\Sage::$files is deprecated in /var/www/vhosts/communityservices.org/plum/ag3ieS/themes/alps-wordpress-v3/vendor/roots/acorn/src/Roots/Acorn/Sage/Sage.php on line 65

Having all that stuff show up every single time a page loads 1) blows up my error logs, and 2) makes troubleshooting anything else a nightmare.

To Reproduce
load any page with ALPS3 active

Expected behavior
Fewer PHP errors!

Additional context
Because I'm sick of looking at it, I'm manually editing the theme files as prompted by the error messages. This is something I'd hope y'all would take care of prior to releasing. Many of us depend heavily on error logging and can't afford to have it clogged up by the theme.

@ccharacter
Copy link
Author

I understand that some of this is bundled 3rd-party stuff. But it's still creating issues. . .

@ccharacter
Copy link
Author

ccharacter commented Jun 24, 2024

This code block appears to take care of some of the errors:

/**
 * Use the fully-qualified AllowDynamicProperties, otherwise the #[AllowDynamicProperties] attribute on "MyClass" WILL NOT WORK.
 */
use \AllowDynamicProperties;

#[AllowDynamicProperties]

@ccharacter
Copy link
Author

ccharacter commented Jun 24, 2024

This code block seems to solve the errors generated in /app/template-helpers.php, 134-137, when no header image is present

$headerImages = array('s'=>array(0),'m'=>array(500),'l'=>array(800),'xl'=>array(1100));
		
		if (wp_get_attachment_image_src($thumbId)) {
			$headerImages = [
				's'  => wp_get_attachment_image_src($thumbId, 'horiz__4x3--s'),
				'm'  => wp_get_attachment_image_src($thumbId, 'horiz__4x3--m'),
				'l'  => wp_get_attachment_image_src($thumbId, 'horiz__4x3--l'),
				'xl' => wp_get_attachment_image_src($thumbId, 'horiz__4x3--xl'),
			];
		}

@YauheniKapliarchuk
Copy link
Collaborator

Hi @ccharacter,
Could you please provide:

  • PHP Version;
  • ALPS Theme version;
  • WordPress version;

Thanks!

@ccharacter
Copy link
Author

  • ALPS theme version is 3.15.2.3 (latest, just downloaded)
  • PHP version is 8.2.20 (latest)
  • WordPress version is 6.5.4 (latest)

@ccharacter
Copy link
Author

Since I'm working on a dev site, I'm going to deactivate all plugins just for kicks--though I can't imagine that the errors I mentioned would be affected by a plugin.

@YauheniKapliarchuk
Copy link
Collaborator

Hm, this is strange...
I let me please reproduce it.
Where did you find this errors?

@ccharacter
Copy link
Author

In the error log on the server. (I have logging turned on for my own purposes.)

@ccharacter
Copy link
Author

I'm going to spin up another dev site that's completely uncluttered and install ALPS there--see if same thing happens right off.

@YauheniKapliarchuk
Copy link
Collaborator

Could you please spin up a new dev server and don't install theme with checking logs?

I wanna check, that it happens with our theme.

@ccharacter
Copy link
Author

So, checking logs with default theme and zero plugins, yes?

@YauheniKapliarchuk
Copy link
Collaborator

I mean, just empty server without installed theme and check logs.

@ccharacter
Copy link
Author

FWIW, I'm working on the NAD Cloud. This test site is a single site, whereas the other one I was working on was a multi-site.

Okay, I have set up this dev site: https://yyy.ccharacter.com/
It is running the TwentyTwentytwo theme, with zero active plugins. Log is presently empty.

I installed/activated the aforementioned version of ALPS3, as well as the plugins it wants: Rank Math SEO, Spectra - WordPress Gutenberg Blocks, and Stackable - Page Builder Gutenberg Blocks (also apparently wants SVG Support). NOTHING ELSE IS ACTIVE.

image

@ccharacter
Copy link
Author

Surprise, surprise: here are the errors I mentioned!

image

@ccharacter
Copy link
Author

Just double-checked: when I deactivate ALPS and reactivate the default theme, there are no additional errors. Yup, ALPS is generating errors!

@YauheniKapliarchuk
Copy link
Collaborator

Got it, we have to migrate whole code to the new version of PHP, there are syntax errors. I am going to update our dependencies.

Thanks for your request!

@ccharacter
Copy link
Author

Do you know for sure that these errors did not show up with PHP 8.1? Because that's the version REQUIRED BY ALPS!

@ccharacter
Copy link
Author

I appreciate you taking care of the problem. It's nice to work with someone who responds in a timely fashion. (I understand that this will be something that might make it into the next version, not something I'll see fixed tomorrow or next week.)

@ccharacter
Copy link
Author

Any reason on your end that I should not shut down my yyy dev site? I don't like to leave it open.

@YauheniKapliarchuk
Copy link
Collaborator

Do you know for sure that these errors did not show up with PHP 8.1? Because that's the version REQUIRED BY ALPS!

This is minimal version of PHP

@YauheniKapliarchuk
Copy link
Collaborator

Any reason on your end that I should not shut down my yyy dev site? I don't like to leave it open.

No, you can close it. I am going to prepare some fix of this problem, first will try to reproduce it and we will release it asap.

Thanks!

@ccharacter
Copy link
Author

FWIW, I set the php version back to 8.1, and most of the errors disappeared. Unfortunately, that is not the case on the site I'm actively working on. Still getting these few--but they are based on a dynamically generated file and not so easy to track down. :-(

image

@YauheniKapliarchuk
Copy link
Collaborator

Could you please send here all of these errors, because this is also syntax errors which reproduced just with new versions.

Thanks!

@ccharacter
Copy link
Author

Is this what you wanted? To have it in not-just-graphic form?

[24-Jun-2024 17:42:45 UTC] PHP Warning:  Undefined variable $post in /var/www/vhosts/communityservices.org/plum/ag3ieS/cache/acorn/framework/views/68f3e4d35185037f075f624cc25ddfc1397c8b03.php on line 15
[24-Jun-2024 17:42:45 UTC] PHP Warning:  Attempt to read property "ID" on null in /var/www/vhosts/communityservices.org/plum/ag3ieS/cache/acorn/framework/views/68f3e4d35185037f075f624cc25ddfc1397c8b03.php on line 15
[24-Jun-2024 17:42:45 UTC] PHP Warning:  Undefined variable $post in /var/www/vhosts/communityservices.org/plum/ag3ieS/cache/acorn/framework/views/68f3e4d35185037f075f624cc25ddfc1397c8b03.php on line 22
[24-Jun-2024 17:42:45 UTC] PHP Warning:  Attempt to read property "ID" on null in /var/www/vhosts/communityservices.org/plum/ag3ieS/cache/acorn/framework/views/68f3e4d35185037f075f624cc25ddfc1397c8b03.php on line 22

@YauheniKapliarchuk
Copy link
Collaborator

Yes, nice!

@YauheniKapliarchuk
Copy link
Collaborator

Will be in a contact, I am going to notify you about new release!

@YauheniKapliarchuk
Copy link
Collaborator

Hi @ccharacter,

Could you please check out latest version of ALPS Theme 3.15.2.5: https://github.com/adventistchurch/alps-wordpress/releases/tag/v3.15.2.5

Thanks!

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

5 participants