Skip to content

Conversation

@FrancoisCapon
Copy link

@FrancoisCapon FrancoisCapon commented May 22, 2021

Avoid Warning of PHP 8 on unknown properties on the $field object in function select()

@hemroy21 has open an issue on my "adminer sqlite repository":

and on SourceForge:

We made some tests and the conclusion is that the issue is not specific to sqlite but only to PHP 8.0 (Warning vs Notice).

<?php
highlight_file(__FILE__);
echo '<p>'.PHP_VERSION.'</p>';
$object = (object) array ();
var_dump($object);
var_dump($object->property);

7.4.15

object(stdClass)#1 (0) { }
Notice: Undefined property: stdClass::$property in ... on line 6
NULL

8.0.2

object(stdClass)#1 (0) { }
Warning: Undefined property: stdClass::$property in ... on line 6
NULL
  • Therefore, each unknown property must be set with PHP 8.0 to avoid warnings.

Avoid Warning of PHP 8 on unknown properties on the `$field` object in function `select()`
@hemroy21
Copy link

Untitled

@FrancoisCapon FrancoisCapon changed the title Avoid Warning of PHP 8 on unknown properties Avoid Warning of PHP 8 on unknown properties (bug #801) May 23, 2021
@AnnoyingTechnology
Copy link

Any chance of a merge ?

Issue is still present with SQLite and latest adminer (4.8.1) + PHP 8.2.12.
I can reproduce exactly what is stated here : https://sourceforge.net/p/adminer/bugs-and-features/801/

@Letme
Copy link

Letme commented Nov 13, 2023

I think maintainer gave up on the repo, so there was a new repo created in: https://github.com/adminerevo/adminerevo which is a fork with an active maintainer team. Maybe re-open there?

@AnnoyingTechnology
Copy link

Thanks for the info!

@Yrr0r
Copy link

Yrr0r commented Nov 13, 2023

I have made a temporary fix.
In line 1484, Col 37, after the opening parenthesis, insert the following:
error_reporting(E_ERROR | E_PARSE);
This will silence the warning so it doesn't break the table layout.

@AnnoyingTechnology
Copy link

It seems fixed on 4.8.3 from AdminerEvo's repo.

@Yrr0r
Copy link

Yrr0r commented Nov 13, 2023

4.8.3 seems still had the same issue, it's now at line 1525. I'm still using the same fix.

@thdaguin
Copy link

thdaguin commented Feb 27, 2024

Hi,
Still here in 4.8.3 (php 8.2).

Depending on what language you choose, workaround maybe on another line.

Search something like this (line 1517 for me) :
select($H,$g=null,$Ef=array(),$z=0){global$x;

and add error_reporting(E_ERROR | E_PARSE); :
select($H,$g=null,$Ef=array(),$z=0){error_reporting(E_ERROR | E_PARSE);global$x;

@peterpp
Copy link
Contributor

peterpp commented Sep 8, 2024

I took another approach here adminneo-org/adminneo@b542b66, but thanks for sharing your solution.

@vrana
Copy link
Owner

vrana commented Feb 19, 2025

This error is now silenced.

@vrana vrana closed this Feb 19, 2025
@FrancoisCapon
Copy link
Author

This error is now silenced $=&gt;$ New Adminer/SQLite released: Adminer 4.17.1 and Plugin SQLite3 1.1

Welcome back! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants