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

Creation of dynamic property is deprecated #228

Open
krabina opened this issue Jun 14, 2024 · 5 comments
Open

Creation of dynamic property is deprecated #228

krabina opened this issue Jun 14, 2024 · 5 comments
Labels

Comments

@krabina
Copy link
Contributor

krabina commented Jun 14, 2024

Setup and configuration

  • SMW version: 4.1.3
  • SESP version: 3.0.5
  • MW version: 1.39.7
  • PHP version: 8.2
  • DB (MySQL etc. and version):

Issue

Using php 8.2. shows a lot of deprecation warnings (also happening in PHP 8.1)

2024/06/14 07:04:22 [error] 18561#18561: *69922 FastCGI sent in stderr: "PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property SESP\PropertyDefinitions::$cfg is deprecated in /extensions/SemanticExtraSpecialProperties/src/PropertyDefinitions.php on line 58; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243" while reading response header from upstream, client: 10.106.223.30, server: , request: "GET /Rosenbaumgarten HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wiki.sock:", host: "www."
2024/06/14 07:04:23 [error] 18561#18561: *69922 FastCGI sent in stderr: "PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property SESP\PropertyDefinitions::$cfg is deprecated in /extensions/SemanticExtraSpecialProperties/src/PropertyDefinitions.php on line 58; PHP message: PHP Deprecated:  Creation of dynamic property Title::$smwLikelyOutdatedDependencies is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243" while reading response header from upstream, client: 10.106.223.30, server: , request: "GET /Danhausergasse HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wiki.sock:", host: "www."
2024/06/14 07:04:23 [error] 18562#18562: *71118 FastCGI sent in stderr: "PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property SESP\PropertyDefinitions::$cfg is deprecated in /extensions/SemanticExtraSpecialProperties/src/PropertyDefinitions.php on line 58; PHP message: PHP Deprecated:  Creation of dynamic property Title::$smwLikelyOutdatedDependencies is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243" while reading response header from upstream, client: 10.106.223.30, server: , request: "GET /Rosstummelplatz HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wiki.sock:", host: "www."
2024/06/14 07:04:23 [error] 18561#18561: *70464 FastCGI sent in stderr: "PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property SESP\PropertyDefinitions::$cfg is deprecated in /extensions/SemanticExtraSpecialProperties/src/PropertyDefinitions.php on line 58; PHP message: PHP Deprecated:  Creation of dynamic property Title::$smwLikelyOutdatedDependencies is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243" while reading response header from upstream, client: 10.106.223.30, server: , request: "GET /Buchhandlung_Richard_L%C3%A1nyi HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wiki.sock:", host: "www."
2024/06/14 07:04:24 [error] 18561#18561: *70464 FastCGI sent in stderr: "PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property SESP\PropertyDefinitions::$cfg is deprecated in /extensions/SemanticExtraSpecialProperties/src/PropertyDefinitions.php on line 58; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243" while reading response header from upstream, client: 10.106.223.30, server: , request: "GET /Rote_Garde HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wiki.sock:", host: "www."
2024/06/14 07:04:25 [error] 18561#18561: *70464 FastCGI sent in stderr: "PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property SESP\PropertyDefinitions::$cfg is deprecated in /extensions/SemanticExtraSpecialProperties/src/PropertyDefinitions.php on line 58; PHP message: PHP Deprecated:  Creation of dynamic property Title::$smwLikelyOutdatedDependencies is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243" while reading response header from upstream, client: 10.106.223.30, server: , request: "GET /Bratislava HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wiki.sock:", host: "www."
2024/06/14 07:04:25 [error] 18562#18562: *71118 FastCGI sent in stderr: "PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property SESP\PropertyDefinitions::$cfg is deprecated in /extensions/SemanticExtraSpecialProperties/src/PropertyDefinitions.php on line 58; PHP message: PHP Deprecated:  Creation of dynamic property Title::$smwLikelyOutdatedDependencies is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243; PHP message: PHP Deprecated:  Creation of dynamic property Title::$isApprovable is deprecated in /includes/debug/DeprecationHelper.php on line 243" while reading response header from upstream, client: 10.106.223.30, server: , request: "GET /Adresse:Rieglgasse_87-89(HAUS_9) HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wiki.sock:", host: "www."
2024/06/14 07:04:25 [error] 18561#18561: *70770 FastCGI sent in stderr: "PHP message: PHP Deprecated:  Creation of dynamic property SESP\PropertyDefinitions::$cfg is deprecated in /extensions/SemanticExtraSpecialProperties/src/PropertyDefinitions.php on line 58; PHP message: PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /extensions/PageForms/includes/PF_TemplateField.php on line 186; PHP message: PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /extensions/PageForms/includes/PF_TemplateField.php on line 186; PHP message: PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /extensions/PageForms/includes/PF_TemplateField.php on line 186; PHP message: PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /extensions/PageForms/includes/PF_TemplateField.php on line 186; PHP message: PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /extensions/PageForms/includes/PF_TemplateField.php on line 186; PHP message: PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /extensions/PageForms/includes/PF_TemplateField.php on line 186; PHP message: PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /extensions/PageForms/includes/PF_TemplateField.php on line 186; PHP message: PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /extensions/PageForms/includes/PF_TemplateField.php on line 186; PHP message: PHP Deprecated:  trim(): Passing null to parameter #1 ($stri

$cfg = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'sespg' );

https://stackoverflow.com/questions/74991682/php-8-2-dynamic-properties-deprecated-how-to-use-them-anyway-in-a-compatible-wa

@krabina krabina added the bug label Jun 14, 2024
@alex-mashin
Copy link
Collaborator

It's upstream. Should be reported there: https://phabricator.wikimedia.org/tag/php_8.2_support/. Don't know if they will patch MediaWiki 1.39 for compatibility with PHP 8.2.

@krabina
Copy link
Contributor Author

krabina commented Jun 14, 2024

But it also happens in PHP 8.1

@krabina
Copy link
Contributor Author

krabina commented Jun 14, 2024

No, correction. It only happens in 8.2. In 8.1 only this one is shown:
Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /vendor/easyrdf/easyrdf/lib/Http/Response.php on line 170

@thomas-topway-it
Copy link
Contributor

thomas-topway-it commented Jun 14, 2024

the smw errors could be solved from here

		if (
			$postEdit === null &&
			$pagePurge &&
			DependencyValidator::hasLikelyOutdatedDependencies( $title ) ) {
			// Only push a purge when it is known that it not a postEdit action
			// to avoid recursive purges
			$attributes['data-title'] = $title->getPrefixedDBKey();
			$attributes['data-msg'] = 'smw-purge-update-dependencies';
			$attributes['data-forcelinkupdate'] = true;
			return Html::rawElement( 'div', [ 'class' => 'smw-postproc page-purge' ] + $attributes );
		} elseif (
			$postEdit === null &&
			DependencyValidator::hasLikelyOutdatedDependencies( $title ) ) {
			// We still suspect outdated query dependencies but only
			// force an update of the parserCache without a purge since
			// we don't have any `@annotation` queries that would require
			// to recompute any pending annotations
			$parameters = [
				'action' => 'post-processing-query-dependency'
			];

			$parserCachePurgeJob = new ParserCachePurgeJob( $title, $parameters );
			$parserCachePurgeJob->updateParserCache();
		}

(src/PostProcHandler.php)
(passing $this->parserOutput inside DependencyValidator::hasLikelyOutdatedDependencies instead of $title)

and using $this->parserOutput->setExtensionData or setProperty (inside markTitle) (unless there is a good reason to not use them)

also considering this comment

	/**
	 * Signal to the `OutputPageParserOutput` hook to we want a possible purge
	 * action.
	 *
	 * @since 3.1
	 *
	 * @param Title $title
	 */
	public function markTitle( Title $title ) {
		$title->smwLikelyOutdatedDependencies = true;
	}

(src/DependencyValidator.php)

@thomas-topway-it
Copy link
Contributor

regarding $title->isApprovable I couldn't find where it comes from

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

3 participants