zeropingheroes / lanager

LAN party management web application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ErrorException (E_NOTICE): Trying to get property of non-object

klitztuch opened this issue · comments

Opened a new Event and tried to signup for it.

ErrorException thrown with message "Trying to get property of non-object"

Stacktrace:
#25 ErrorException in /var/www/lanager/app/Domain/EventSignups/EventSignupService.php:85
#24 Illuminate\Exception\Handler:handleError in /var/www/lanager/app/Domain/EventSignups/EventSignupService.php:85
#23 Zeropingheroes\Lanager\Domain\EventSignups\EventSignupService:domainRulesOnStore in /var/www/lanager/app/Domain/ResourceService.php:307
#22 Zeropingheroes\Lanager\Domain\ResourceService:applyDomainRules in /var/www/lanager/app/Domain/ResourceService.php:257
#21 Zeropingheroes\Lanager\Domain\ResourceService:runChecks in /var/www/lanager/app/Domain/ResourceService.php:163
#20 Zeropingheroes\Lanager\Domain\ResourceService:store in /var/www/lanager/app/Domain/EventSignups/EventSignupService.php:26
#19 Zeropingheroes\Lanager\Domain\EventSignups\EventSignupService:store in /var/www/lanager/app/Http/Gui/ResourceServiceController.php:59
#18 Zeropingheroes\Lanager\Http\Gui\ResourceServiceController:processStore in /var/www/lanager/app/Http/Gui/EventSignupsController.php:42
#17 Zeropingheroes\Lanager\Http\Gui\EventSignupsController:store in <#unknown>:0
#16 call_user_func_array in /var/www/lanager/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:231
#15 Illuminate\Routing\Controller:callAction in /var/www/lanager/bootstrap/compiled.php:5847
#14 Illuminate\Routing\ControllerDispatcher:call in /var/www/lanager/bootstrap/compiled.php:5835
#13 Illuminate\Routing\ControllerDispatcher:dispatch in /var/www/lanager/bootstrap/compiled.php:5040
#12 Illuminate\Routing\Router:Illuminate\Routing\{closure} in <#unknown>:0
#11 call_user_func_array in /var/www/lanager/bootstrap/compiled.php:5398
#10 Illuminate\Routing\Route:run in /var/www/lanager/bootstrap/compiled.php:5065
#9 Illuminate\Routing\Router:dispatchToRoute in /var/www/lanager/bootstrap/compiled.php:5053
#8 Illuminate\Routing\Router:dispatch in /var/www/lanager/vendor/dingo/api/src/Routing/Router.php:205
#7 Dingo\Api\Routing\Router:dispatch in /var/www/lanager/bootstrap/compiled.php:715
#6 Illuminate\Foundation\Application:dispatch in /var/www/lanager/bootstrap/compiled.php:696
#5 Illuminate\Foundation\Application:handle in /var/www/lanager/bootstrap/compiled.php:7825
#4 Illuminate\Session\Middleware:handle in /var/www/lanager/bootstrap/compiled.php:8432
#3 Illuminate\Cookie\Queue:handle in /var/www/lanager/bootstrap/compiled.php:8379
#2 Illuminate\Cookie\Guard:handle in /var/www/lanager/bootstrap/compiled.php:11088
#1 Stack\StackedHttpKernel:handle in /var/www/lanager/bootstrap/compiled.php:657
#0 Illuminate\Foundation\Application:run in /var/www/lanager/public/index.php:49

Try this fix:

69a3349

No, dont work. I'm getting another error.

ErrorException thrown with message "Undefined property: Zeropingheroes\Lanager\Domain\EventSignups\EventSignupService::$input"

Stacktrace:
#25 ErrorException in /var/www/lanager/app/Domain/EventSignups/EventSignupService.php:85
#24 Illuminate\Exception\Handler:handleError in /var/www/lanager/app/Domain/EventSignups/EventSignupService.php:85
#23 Zeropingheroes\Lanager\Domain\EventSignups\EventSignupService:domainRulesOnStore in /var/www/lanager/app/Domain/ResourceService.php:307
#22 Zeropingheroes\Lanager\Domain\ResourceService:applyDomainRules in /var/www/lanager/app/Domain/ResourceService.php:257
#21 Zeropingheroes\Lanager\Domain\ResourceService:runChecks in /var/www/lanager/app/Domain/ResourceService.php:163
#20 Zeropingheroes\Lanager\Domain\ResourceService:store in /var/www/lanager/app/Domain/EventSignups/EventSignupService.php:26
#19 Zeropingheroes\Lanager\Domain\EventSignups\EventSignupService:store in /var/www/lanager/app/Http/Gui/ResourceServiceController.php:59
#18 Zeropingheroes\Lanager\Http\Gui\ResourceServiceController:processStore in /var/www/lanager/app/Http/Gui/EventSignupsController.php:42
#17 Zeropingheroes\Lanager\Http\Gui\EventSignupsController:store in <#unknown>:0
#16 call_user_func_array in /var/www/lanager/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:231
#15 Illuminate\Routing\Controller:callAction in /var/www/lanager/bootstrap/compiled.php:5847
#14 Illuminate\Routing\ControllerDispatcher:call in /var/www/lanager/bootstrap/compiled.php:5835
#13 Illuminate\Routing\ControllerDispatcher:dispatch in /var/www/lanager/bootstrap/compiled.php:5040
#12 Illuminate\Routing\Router:Illuminate\Routing\{closure} in <#unknown>:0
#11 call_user_func_array in /var/www/lanager/bootstrap/compiled.php:5398
#10 Illuminate\Routing\Route:run in /var/www/lanager/bootstrap/compiled.php:5065
#9 Illuminate\Routing\Router:dispatchToRoute in /var/www/lanager/bootstrap/compiled.php:5053
#8 Illuminate\Routing\Router:dispatch in /var/www/lanager/vendor/dingo/api/src/Routing/Router.php:205
#7 Dingo\Api\Routing\Router:dispatch in /var/www/lanager/bootstrap/compiled.php:715
#6 Illuminate\Foundation\Application:dispatch in /var/www/lanager/bootstrap/compiled.php:696
#5 Illuminate\Foundation\Application:handle in /var/www/lanager/bootstrap/compiled.php:7825
#4 Illuminate\Session\Middleware:handle in /var/www/lanager/bootstrap/compiled.php:8432
#3 Illuminate\Cookie\Queue:handle in /var/www/lanager/bootstrap/compiled.php:8379
#2 Illuminate\Cookie\Guard:handle in /var/www/lanager/bootstrap/compiled.php:11088
#1 Stack\StackedHttpKernel:handle in /var/www/lanager/bootstrap/compiled.php:657
#0 Illuminate\Foundation\Application:run in /var/www/lanager/public/index.php:49

Just realized this is the same issue I am getting. (issue 95), I get a 500 Internal server error. using files downloaded a week ago.

there is no solution yet?

I'm getting this issue too.
I'm going to try and find a fix in my spare time.

Awesome, thanks Jacob. Open source in action!

Would you like to submit a pull request, or shall I just fix it and commit?
On 8 Jan 2016 10:14 am, "Jacob Murphy" notifications@github.com wrote:

I HAVE FOUND THE ISSUE!
After a little bit of digging around, It turns out that the issue is case
sensitive letters!
Find the File "Event.php" under /app/Domain/Events/Event.php.
Go to line 51 and 53, and replace "$userId" with "$userid".
Notice the letter i (eye), one is capital, one is not.

After replacing the capital i with the lower case i, it should all work
fine!


Reply to this email directly or view it on GitHub
#93 (comment)
.

Update: I have found the (real) fix this time.
Checked and tested here: http://totallynot.murbak.com.au/a/3cb7.png
In the file "EventSignupService.php", under /app/Domain/EventSignups/
On line 85, replace >> $this->input['user_id'] <<
With >> $this->user->id() <<

New code should look like this:
if ( $event->hasSignupFromUser( $this->user->id() ) )

Sorry about the earlier stuff up, I forgot to uncomment the offending code * slaps forehead *.

OpenSource for the win :D

thanks for your fix

This may have other implications but I'm going to merge this for now. Thanks for your work PoxyDoxy

I'm going to have to reopen this, because the issue still exists for those without a role (Normal Users, Those who are not Admin / Event Manager), etc.
I only found out about it tonight, when one of the normal users went to sign up to an event.

Yep, just as expected, there is another offending " input['user_id'] " on line 75.
To Fix Signup for Normal Accounts:
Edit File: /app/Domain/EventSignups/EventSignupService.php
Go to Line: 75.
Replace: $this->input['user_id']
With: $input['user_id']

This will allow Normal Users to Sign up for events.
However I have stumbled across another Issue, where normal users cannot remove themself from an event (The "Remove Signup" option is missing).