Error Auth Laravel MongoDB - php

I had a problem like this:
The argument 2 just passed to Illuminate\Database\Query\Builder:: the__ construct() must be an instance of Illuminate\Database\Query\Grammars\Grammar, null given, called in E:\xampp\htdocs\skripsi\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php on line 1899 and defined.
As has been explained in the https://github.com/jenssegers/laravel-mongodb#troubleshooting way to fix it is twofold. Already I did as instructed but still error as above. How do I fix it?

Related

phpstan and psalm ail because of an unidentifiable problem

For a php project, for some time my tests fail for phpstan and psalm, with unclear error messages.
I tried to debug, to rebuild the commits, but without success. I can't understand or so.
These are the output, the composer.json and the ci.yml.
I can spot these lines. For psalm:
Uncaught Error: Call to undefined method ReflectionUnionType::getName() in phar:///home/runner/work/me-tools/me-tools/vendor/psalm/phar/psalm.phar/src/Psalm/Internal/Codebase/Reflection.php:262
And for phpstan:
PHP Warning: Undefined array key "PHPStan\Rules\Arrays\DuplicateKeysInLiteralArraysRule" in phar:///home/runner/work/me-tools/me-tools/vendor/phpstan/phpstan/phpstan.phar/vendor/nette/utils/src/Utils/Reflection.php on line 180
Warning: Undefined array key "PHPStan\Rules\Arrays\DuplicateKeysInLiteralArraysRule" in phar:///home/runner/work/me-tools/me-tools/vendor/phpstan/phpstan/phpstan.phar/vendor/nette/utils/src/Utils/Reflection.php on line 180
PHP Fatal error: Uncaught TypeError: _HumbugBox5f943a942674\Nette\Utils\Reflection::getUseStatements(): Return value must be of type array, null returned in phar:///home/runner/work/me-tools/me-tools/vendor/phpstan/phpstan/phpstan.phar/vendor/nette/utils/src/Utils/Reflection.php:180
But I didn't help and even looking on the net I didn't find anything useful.
The strangest thing is that I can't replicate this problem. In fact, locally, with the same configuration, I have no problem.
One possible hypothesis about that Call to undefined method ReflectionUnionType::getName () is that somewhere there might be something like:
public function myMethod(): int | float
but I have checked the code and I am not aware of any of this.
Can anyone help me debug?
These are unrelated separate problems. You’ll have higher luck asking about them in Psalm and PHPStan GitHub issue trackers.

createEnvelope with CompositeTemplate error

Modifying the sample code for embedded signing to use a CompositeTemplate resulted in the following error.
msg: Access to undeclared static property: stdClass::$swaggerTypes
file: $home/lib/docusign/src/ObjectSerializer.php
line: 68
This happens on the attempt to serialize SignHere:scale_value, which is an object, but a standard object, not a Swagger object, and the serializer assumes ALL objects are Swagger objects. Not sure if the SDK is mistakenly assuming scale_value is an object (seems it should just be a scalar) or there's a missing ScaleValue model class.
Anyone run into this before?
Yep, this was definitely a bug in the SDk. Bug reported but no idea how long it will take to be fixed.
If you run into this issue, just open src/Model/SignHere.php and change the type of scale_value to string instead of object.

Jomsocial error - Notice: JFactory::getUser(): The script tried to execute a method or access a property of an incomplete object

Im getting 2 errors. I saw that Jomsocial had the problem with their own site and fixed it but never posted how. Happens when you go to post an update in jomsocial and it locks up. You refresh the page and get
Error
Sorry, User ID not found.
with the following errors. Then you go login and check the profile and the update was posted fine.
Notice: JFactory::getUser(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "CUser" of the object you are trying to operate on was loaded before unserialize() gets called or provide a __autoload() function to load the class definition in /home/xxxxxxx/public_html/libraries/joomla/factory.php on line 244
Notice: CUser::CUser(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "CUser" of the object you are trying to operate on was loaded before unserialize() gets called or provide a __autoload() function to load the class definition in /home/xxxxxx/public_html/components/com_community/libraries/user.php on line 52
What version of JomSocial do you use? This issue shouldn't happen

Smfony2: Getting an error when trying to use translatble behavior extension

I am trying to use translatable behavior in my project, I followed the doc word by word to how configure and use this behavior , but I am getting this error:
CRITICAL - Uncaught PHP Exception ReflectionException: "Property locale does not exist" at C:\wamp\www\Symfony\vendor\gedmo\doctrine-extensions\lib\Gedmo\Translatable\TranslatableListener.php line 296
Can anyone help please?
Thanks in advance :)
Edit:
This is the line 296:
$reflectionProperty = $class->getProperty(self::$configurations[$this->name][$meta->name]['locale']);
In my case the required $locale field was defined in an abstract super class of the entity - which is basically fine, however it must not be private but at most protected.

Symfony2 - How to delete/move an entity?

I am learning symfony2 and atfer creating some Doctrine Entities in a bundle, I wanted to move them.
However, after moving, and changing any instances of them being referenced, I was getting errors when trying to run my application.
I moved them back, and everything was fine.
Now I am just tyring to remove them completly, but again, I get errors when doing so.
Any help on removing Entities entirely?
I did exactly the same thing that Mr Pablo did, but for a bundle : I moved a bundle (renamed) and modified all calls to it.
I have the same error :
ErrorException: Catchable Fatal Error: Object of class __PHP_Incomplete_Class could not be converted to string in /Volumes/Data/home/timi/Sites/symfony2/vendor/symfony/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php line 70
in /Volumes/Data/home/timi/Sites/symfony2/vendor/symfony/src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php line 65
at ErrorHandler->handle() in /Volumes/Data/home/timi/Sites/symfony2/vendor/symfony/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php line 70
at AbstractToken->getUsername() in /Volumes/Data/home/timi/Sites/symfony2/vendor/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php line 56
at SecurityDataCollector->collect() in /Volumes/Data/home/timi/Sites/symfony2/vendor/symfony/src/Symfony/Component/HttpKernel/Profiler/Profiler.php line 174
at Profiler->collect() in /Volumes/Data/home/timi/Sites/symfony2/vendor/symfony/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php line 90
at ProfilerListener->onKernelResponse()
at call_user_func() in /Volumes/Data/home/timi/Sites/symfony2/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php line 82
at TraceableEventDispatcher->doDispatch() in /Volumes/Data/home/timi/Sites/symfony2/app/cache/dev/classes.php line 3678
at EventDispatcher->dispatch() in /Volumes/Data/home/timi/Sites/symfony2/app/cache/dev/classes.php line 4754
at ContainerAwareEventDispatcher->dispatch() in /Volumes/Data/home/timi/Sites/symfony2/app/cache/dev/classes.php line 3904
at HttpKernel->filterResponse() in /Volumes/Data/home/timi/Sites/symfony2/app/cache/dev/classes.php line 3896
at HttpKernel->handleRaw() in /Volumes/Data/home/timi/Sites/symfony2/app/cache/dev/classes.php line 3846
at HttpKernel->handle() in /Volumes/Data/home/timi/Sites/symfony2/app/cache/dev/classes.php line 4791
at HttpKernel->handle() in /Volumes/Data/home/timi/Sites/symfony2/app/bootstrap.php.cache line 547
at Kernel->handle() in /Volumes/Data/home/timi/Sites/symfony2/web/app_dev.php line 20
Some help will be very welcomed :)
EDIT:
Well I solved the problem, Adam Stacey had heard it well :)
Before changing anything, I was logged in the website, by using FOSUserBundle firewall.
By changing the name of the bundle, it fooled the firewall and it was stuck at line 70 of ./vendor/symfony/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php
Here is the function :
public function getUsername()
{
if ($this->user instanceof UserInterface) {
return $this->user->getUsername();
}
return (string) $this->user;
}
So I commented out the line return (string) $this->user;, reloaded the webpage, logged out, than reverted the comment. And voilà !
What kind of errors were you getting?
Make sure you:
Clear cache
Rebuild database
Don't have any entity relationships with it
Don't have any code based on the entities
Like Inori mentioned have you tried rebuilding your entities?
If not try this from the CLI:
php app/console doctrine:generate:entities Acme
php app/console doctrine:schema:update --force
Replace "Acme" with your name, company name or whatever you have used in your bundles.
The other thing you may have to do is remove any instances where you have used the entities.
For example, you may have some entities in the controllers that look like this:
use Acme\BundleName\Entity\SomeEntity;
use Acme\BundleName\Entity\AnotherEntity;
They will need to be removed.
If you have the details of the particular errors that are coming up let me know what they are and I will try and help you further.
I have heard that this can also sometimes be to do with sessions. Are you using any bundles for authentication or anything like that?
In your php.ini file do you have your set to:
session.auto_start = Off
This may be way off, but worth a go. Let me know.
On a separate note. Did your server setup pass the checks in the app/check.php file that you can run via CLI?

Categories