Page MenuHomePhabricator

"Fatal error: Call to a member function getEmail() on a non-object" in SemanticTasks.classes.php
Closed, ResolvedPublic

Description

Description from: https://www.mediawiki.org/wiki/Extension_talk:Semantic_Tasks

Error in MW 1.23.x and SMW 2.3

Upon saving a page that assignes a value to the property Assigned to:: the follwing error is displayed.

Fatal error: Call to a member function getEmail() on a non-object in .../extensions/SemanticTasks/SemanticTasks.classes.php on line 293

Only when I deactivate the extension I can save the page.

Tosfos (talkcontribs)
Please try the following change in that file, at around line 179:

                        $assignee_name = $task_assignees->getNextText( SMW_OUTPUT_WIKI );
                        /** @todo Create User object */
                        $assignee_name = explode( ":", $assignee_name );
+                       
+                       if ( !isset( $assignee_name[1] ) ) {
+                               return array();
+                       }
                        $assignee_name = $assignee_name[1];

Event Timeline

@Fustbariclation: Thanks for taking a look at the code!
You are very welcome to use developer access to submit the proposed code changes as a Git branch directly into Gerrit (under mediawiki/extensions/SemanticTasks) which makes it easier to review them quickly and provide feedback. If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader. Thanks again!

And I have no idea where SemanticTasks issues should get reported... Cannot see it listed on https://github.com/SemanticMediaWiki and https://www.mediawiki.org/wiki/Extension:Semantic_Tasks provides no hints either. @JeroenDeDauw: Do you maybe have an idea?

Looks like the last substantial updates where merged by @Yaron_Koren (and presumably made by WikiWorks), so perhaps he knows

I believe that Phabricator is the right spot for reporting issues concerning this extension since the repo is wmfgit (diffusion). Thanks for the code suggestion!

Sorry, I have no idea. It's been a long time since I looked at that code...

As nobody seems to feel responsible / maintaining that extension I'm afraid this task and its code will rot here. (Just communicating expectations here.)

Aklapper renamed this task from Please add fix to next release of SemanticTasks.classes.php to "Fatal error: Call to a member function getEmail() on a non-object" in SemanticTasks.classes.php.Apr 20 2016, 5:28 AM
Aklapper triaged this task as Low priority.

I just updated the extension's page to reflect the fact that it is unmaintained. I will also now do a pull request, however since it is in the WMF repo we need somebody to +2 like for this commit too. It is not so easy to find somebody with +2 rights except for lego. Let's see.

I just merged it in - for some reason, I have +2 rights for this extension.

Thanks for the improvement! A little late, of course.... :)

Change 284476 had a related patch set uploaded (by Kghbln):
Provide fix for MW 1.23

https://gerrit.wikimedia.org/r/284476

@Yaron_Koren Cool! I was not sure so thanks a lot. :)

Change 284476 merged by Yaron Koren:
Provide fix for MW 1.23

https://gerrit.wikimedia.org/r/284476

Kghbln claimed this task.

@Yaron_Koren Again, thanks for doing the +2. So users of MW 1.23+ should use REL1_27 of this extension. @tosfos Thanks for the code suggestion and @Fustbariclation thanks for testing it.