JeroenDeDauw / ParamProcessor

Declarative parameter processing library
https://entropywins.wtf
Other
20 stars 4 forks source link

PHP Notice: Undefined index: value #43

Open kghbln opened 5 years ago

kghbln commented 5 years ago

Setup

Issue

PHP Notice:  Undefined index: value in /../w/includes/registration/ExtensionProcessor.php on line 504
Notice: Undefined index: value in /../w/includes/registration/ExtensionProcessor.php on line 504

This started to spam my inbox yesterday evening since I get this note every time cron works on the job queue which is every 3 minutes. Since the update of ParamProcessor was the only major difference I suppose that the root cause may be found here. I am just speculating since no stack trace is produced.

kghbln commented 5 years ago

Now I see this: https://github.com/JeroenDeDauw/ParamProcessor/issues/36 So it may indeed be PP.

JeroenDeDauw commented 5 years ago

Do you have more of a trace?

JeroenDeDauw commented 5 years ago

Not clear to me why this would be a ParamProcessor issue and does not seem related to #36

mwjames commented 5 years ago

PHP Notice: Undefined index: value in /../w/includes/registration/ExtensionProcessor.php on line 504

Most likely caused by some extension.json (configuration settings) value where the ExtensionProcessor [0] doesn't validate the input correctly. See https://phabricator.wikimedia.org/T141289 for a similar case, anyway that should be reported in phap.

[0] https://github.com/wikimedia/mediawiki/blob/62dc614600bcb00a556f7295f5c008d04cdc75a9/includes/registration/ExtensionProcessor.php#L500-L504

JeroenDeDauw commented 5 years ago

I did make a ton of changes in this library so would not be surprised if something broke, especially given the lack of tests in this thing. It has no extension.json though.

kghbln commented 5 years ago

Do you have more of a trace?

No, I do not get a stack trace. Dunno why.

kghbln commented 5 years ago

Not clear to me why this would be a ParamProcessor issue and does not seem related to #36

Since the title "PHP Notice: Undefined index: original-value" was almost identical. Anyways I said that I am speculation and you may very well ignore speculation moreover if it is wrong. ;)

kghbln commented 5 years ago

anyways that should be reported in phab.

Reported upstream. I am sure we will find the transgressing software.

mwjames commented 5 years ago

Reported upstream. I am sure we will find the transgressing software.

In case you don't get a stack trace, try adding the following snippet before the mentioned line.

+               if ( !isset( $data['value'] ) ) {
+                   throw new RuntimeException( "Missing `value` index for: " .
json_encode( $info ) );
+
+               }

                $value = $data['value'];

On 8/6/19, Karsten Hoffmeyer notifications@github.com wrote:

anyways that should be reported in phab.

Reported upstream. I am sure we will find the transgressing software.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/JeroenDeDauw/ParamProcessor/issues/43#issuecomment-518288780

mwjames commented 5 years ago

... you should stop any experiment in you are doing in LocalSettings.php ...

On 8/6/19, James HK jamesin.hongkong.1@gmail.com wrote:

Reported upstream. I am sure we will find the transgressing software.

In case you don't get a stack trace, try adding the following snippet before the mentioned line.

+             if ( !isset( $data['value'] ) ) {
+                 throw new RuntimeException( "Missing `value` index for: " .
json_encode( $info ) );
+
+             }

              $value = $data['value'];

On 8/6/19, Karsten Hoffmeyer notifications@github.com wrote:

anyways that should be reported in phab.

Reported upstream. I am sure we will find the transgressing software.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/JeroenDeDauw/ParamProcessor/issues/43#issuecomment-518288780

kghbln commented 5 years ago

In case you don't get a stack trace, try adding the following snippet before the mentioned line.

Thanks for the tip. However this causes fatals.

mwjames commented 5 years ago

Thanks for the tip. However this causes fatals.

Okay try to replace the isset with:

!array_key_exists( 'value', $data )

On 8/6/19, Karsten Hoffmeyer notifications@github.com wrote:

In case you don't get a stack trace, try adding the following snippet before the mentioned line.

Thanks for the tip. However this causes fatals.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/JeroenDeDauw/ParamProcessor/issues/43#issuecomment-518324535

mwjames commented 5 years ago

To clarify, you applied the suggested changes to ExtensionProcessor.php, right?

On 8/6/19, James HK jamesin.hongkong.1@gmail.com wrote:

Thanks for the tip. However this causes fatals.

Okay try to replace the isset with:

!array_key_exists( 'value', $data )

On 8/6/19, Karsten Hoffmeyer notifications@github.com wrote:

In case you don't get a stack trace, try adding the following snippet before the mentioned line.

Thanks for the tip. However this causes fatals.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/JeroenDeDauw/ParamProcessor/issues/43#issuecomment-518324535