Uncaught FacebookApiException: Unsupported operation thrown in - php

I just built an application with the facebook graph API, and it's been running smoothly till now..
Whenever I go to my website I'm now getting the error
Uncaught FacebookApiException: Unsupported operation thrown on line 1254
Here is line 1254
$e = new FacebookApiException($result);
When I ran a debug, this is what I got
Open Graph Warnings That Should Be Fixed
Inferred Property:
The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property:
The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property:
The 'og:description' property should be explicitly provided, even if a value can be inferred from other tags.
Does anyone know what's causing this?

You have to be logged in to the facebook app before you can call the graph API.
I had my API calls outside the
if ($user_is_logged_in)
do this
Should have known, but it was an honest mistake!

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.

Google_Http_MediaFileUpload constructor must implement interface Psr\Http\Message\RequestInterface

I am trying to upload large files in newly created folder in google drive via php .
but when I am not using
$client->setDefer(true);
Then I am getting this error:
Catchable fatal error: Argument 2 passed to Google_Http_MediaFileUpload::__construct() must implement interface Psr\Http\Message\RequestInterface, instance of Google_Service_Drive_DriveFile given, called in /var/www/html/google_drive2/gdrive_upload.php on line 158 and defined in /var/www/html/google_drive2/src/Google/Http/MediaFileUpload.php on line 78
And when I use
$client->setDefer(true);
Then i get this:
Uncaught exception 'Google_Service_Exception' with message 'Not Found' in /var/www/html/google_drive2/src/Google/Http/REST.php on line 118
( ! ) Google_Service_Exception: Not Found in /var/www/html/google_drive2/src/Google/Http/REST.php on line 118
Tried everything but fails. please tell what I am doing wrong.
Here is my complete code of gdrive_upload.php
https://pastebin.com/x96CZg3U
The error:
Google_Service_Exception: Not Found in /path/to/src/Google/Http/REST.php on line 118
occurs when you are passing an invalid reference to the Google API and the API cannot find the resource you are requesting.
For example, when adding a file to Google Drive, this will show when an invalid Google Drive Id is passed.
When adding an event to Google Calendar, this will show when an invalid Google Calendar Id is passed.
Etc.
In your case, the folder is probably not fully set up yet. So you are using a valid Id, but Google has not fully created the folder. Using $client->setDefer(true) probably allows Google enough time to fully set up the folder, which allows your folder Id to validate.
Disclaimer: This error quite possibly appears for other circumstances as well.

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

Web Service Error:

I'm trying to get some values from a WebService, but I'm getting some error messages when accessing from PHP web application or SoapUI.
When I access the service from Visual Studio .NET I get the right values, but I really need to access this from PHP.
Here is the error message:
<faultstring xml:lang="pt-BR">The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'ConsultaFretePedido'. End element 'xmlPedido' from namespace 'http://tempuri.org/' expected. Found element 'Pedido' from namespace ''. Line 6, position 51.</faultstring>
I guess this is the error:
End element 'xmlPedido' from namespace 'http://tempuri.org/' expected.
Found element 'Pedido' from namespace ''. Line 6, position 51.
that means, that you have started with <xmlPedido> but ended with </Pedido>
look at the xml code, that the webservice is giving back, at line 6
I'd recommend using SOAPui to check the WebService.

Categories