My script runs into an error - can someone help me on this? For me it looks like, that something is not okay with the username?
PHP Fatal error: Uncaught exception 'SpotifyWebAPI\\SpotifyWebAPIException' with message 'An unknown error occurred.' in /mnt/webp/b3/44/5462244/htdocs/SpotifyTest/src/Request.php:38
Stack trace:
#0 /mnt/webp/b3/44/5462244/htdocs/SpotifyTest/src/Request.php(188): SpotifyWebAPI\\Request->parseBody('<html><body><h1...', 400)
#3 /mnt/webp/b3/44/5462244/htdocs/SpotifyTest/testfile.php(68): SpotifyWebAPI\\SpotifyWebAPI->getUserPlaylist('lillabj\\xC3\\xB6rn', '0WXsElmPC8aEGzr...')
#4 {main}
thrown in /mnt/webp/b3/44/5462244/htdocs/SpotifyTest/src/Request.php on line 38
I think it is this line ->
SpotifyWebAPI->getUserPlaylist('**llabj\\xC3\\xB6rn**',.....
I get the username from a mysql table like this
$USERPL = $pl['user_name'];
Would be great if some can give me some help.
I think the problem is related to special characters in the username, the \\xC3\\xB6 part should be an "ö" so the full username is "lillabjörn".
When you run another user request with the same username in the Spotify Web API Console you can see that it's URL encoded in the actual request sent, https://developer.spotify.com/web-api/console/get-users-profile/?user_id=lillabj%C3%B6rn (click the link to see it).
Try URL encoding the username in all user related calls, for example:
$api->getUserPlaylist(urlencode('lillabjörn'), 'playlist_id');
Related
I'm try to use api from
https://github.com/jwilsson/spotify-web-api-php/blob/main/docs/examples/access-token-with-authorization-code-flow.md.
Unfortunately, it doesn't work well because it gets such an error
Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIAuthException: Invalid redirect URI in D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php:56 Stack trace: #0 D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php(244): SpotifyWebAPI\Request->handleResponseError('{"error":"inval...', 400) #1 D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php(112): SpotifyWebAPI\Request->send('POST', 'https://account...', 'client_id=48f0c...', 'HTTP/2 400 \r\nda...') #2 D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Session.php(250): SpotifyWebAPI\Request->account('POST', '/api/token', Array, Array) #3 D:\Software\Development\XAMPP\htdocs\spotif\auth\app\check.php(26): SpotifyWebAPI\Session->requestAccessToken('AQA9X84L0SDucXG...', 'a86937efa85589a...') #4 {main} thrown in D:\Software\Development\XAMPP\htdocs\spotif\auth\vendor\jwilsson\spotify-web-api-php\src\Request.php on line 56
I tried to solve the problem with all methods,but even if in the console of my Spotify application.
I have everything set up well, like the redirect URI in my PHP code, I still get an error.
Changing the redirectURI doesn't help me in any way.
Wait some hours/days fixing my problem
I have website which has Gutenberg and it is very important part of it, problem is..
When i enter page and try to save it i get error 500, in console i have this error in console
POST https://myDomain/wp-json/wp/v2/pages/5950 500 ()
POST https://myDomain/wp-admin/post.php?post=5950&action=edit&classic-editor=1&meta_box=1 500 ()
and this error in my error log
[12-Sep-2018 09:46:18 UTC] PHP Fatal error: Uncaught Exception: Invalid page template. in /usr/www/users/foodno/v32/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-duplication.class.php:99
Stack trace:
#0 /usr/www/users/myDomain/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(4219): WPML_Post_Duplication->make_duplicate(5950, 'he')
#1 /usr/www/users/myDomain/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-synchronization.class.php(84): SitePress->make_duplicate(5950, 'he')
#2 /usr/www/users/myDomain/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-translation.class.php(248): WPML_Post_Synchronization->sync_with_duplicates(5950)
#3 /usr/www/users/myDomain/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-admin-post-actions.class.php(113): WPML_Post_Translation->after_save_post('535', Array, 'en', NULL)
#4 /usr/www/users/myDomain/wp-includes/class-wp-hook.php(288): WPML_Admin_Post_Actions->save_post_actions('5950', Objec in /usr/www/users/foodno/v32/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-duplication.class.php on line 99
I am also using WPML plugin, and on save plugin gets stuck screenshot
Loader is in loop...
Thing is, it saves the edited content, but still it returns error 500, i tried debugging and got absolutely nothing
I have googled it of course before asking and i found these as known Gutenberg issues that occured before... None of these did not help.. Does anyone have any suggestion or solution?
https://github.com/WordPress/gutenberg/issues/5675
https://github.com/WordPress/gutenberg/issues/8410
Thanks in advance
I asked on their git also, and i've got an answer from mr with nickname "brucepearson" and WPML will apparently fix this in next update, here is link to git q/a
https://github.com/WordPress/gutenberg/issues/9816
I am trying to run a Responsive ad example using adwords api library (php) but it is giving me the following error
Fatal error: Uncaught exception 'Google\AdsApi\AdWords\v201702\cm\ApiException' with message '[OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE # operations[0].operand.ad; trigger:'SEARCH']' in C:\xampp\htdocs\adfollower\app\Utils\adfollower\src\Google\AdsApi\Common\Util\Reflection.php:39 Stack trace: #0 C:\xampp\htdocs\adfollower\app\Utils\adfollower\src\Google\AdsApi\Common\Util\Reflection.php(39): ReflectionClass->newInstanceArgs(Array)
#1 C:\xampp\htdocs\adfollower\app\Utils\adfollower\src\Google\AdsApi\Common\AdsSoapClient.php(162): Google\AdsApi\Common\Util\Reflection->createInstance('Google\\AdsApi\\A...', '[OperationAcces...')
#2 C:\xampp\htdocs\adfollower\app\Utils\adfollower\src\Google\AdsApi\Common\AdsSoapClient.php(126): Google\AdsApi\Common\AdsSoapClient->parseApiExceptionFromSoapFault(Object(SoapFault))
#3 C:\xampp\htdocs\adfollower\app\Utils\adfollower\src\Google\AdsApi\AdWords\v201702\cm\AdGroupAdService.php(189): Google\AdsApi\Common\AdsSoapClient->__soapCall('mutate', Array)
#4 C:\xampp\ht in C:\xampp\htdocs\adfollower\app\Utils\adfollower\src\Google\AdsApi\Common\Util\Reflection.php on line 39
The error indicates that you are trying to add a creative to a campaign that is not compatible with its type.
In your specific scenario, you are adding a Responsive Ad to a Search Network Campaign, but this type of creative can only be used in a Display Network Campaign.
The solution is to create a new Display campaign with the proper targetting settings and update the affected campaign ID in your code.
From the error above, it looks like your access details you are providing is incorrect as its giving a permissions error.
You can find an example here:
https://github.com/googleads/googleads-php-lib/tree/master/examples/AdWords
Otherwise can you please paste your code (without your access details) so we can see how you are implementing it.
Server-side datatables. everything is working fine except the search box. Soon as I enter one character in the search, this error shows up:
DataTables warning (table id = 'sample_1'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number' in /home/test/public_html/assets/data-tables/test-pdo.php:99
Stack trace:
#0 /home/test/public_html/assets/data-tables/test-pdo.php(99): PDOStatement->execute()
#1 /home/test/public_html/assets/data-tables/test-pdo.php(143): TableData->get('accounts', 'account_id', Array)
#2 {main}
thrown in /home/test/public_html/assets/data-tables/test-pdo.php on line 99
line 99 is -$statement->execute(); from Bind Parameters
I am using the pdo script for datatables listed here
this is a SQL error not Jquery...
Please check your passed parameters..
The error which you are receiving is because you went something wrong in your php code. jQuery just loads your php page and gives you the output.
In your php code, try setting emulate prepares to false which may be causing the problem. It worked for me when I set it to false.
Validate your JSon response here http://jsonlint.com/
Check if its an invalid or a valid JSON.
Also your Jquery is firing command as soon as you enter some data in search box.
Try checking the Database attribute type for errors (Number or text).
im using RottenTomatoes Api to gain film information. I have a list of 250 films im grabbing information on however i get to a certain point and i get this error. It seems to happen randomly. I'm taking the api results and putting them in my own database. Would there be a reason for such an error?
Fatal error: Uncaught exception 'Exception' with message '0' in /home/ignitet1/public_html/CheckFilm/RottenTomatoes.php:340
Stack trace:
#0 /home/ignitet1/public_html/CheckFilm/RottenTomatoes.php(156): RottenTomatoes->getResource('http://api.rott...')
#1 ****/loadFullData.php(37): RottenTomatoes->getMovieInfo('771269025')
#2 {main}
thrown in ****RottenTomatoes.php</b> on line <b>340</b><br />
on line 340 this is the code. rottentomatoes.php is a php library used to parse the response's from the api.
if (isset($decodedResponse['error']))
throw new Exception('API Error: ' + $decodedResponse['error']);
return $decodedResponse;
Apologies for the poor explanation i'm having trouble finding the code that is causing the issue.
One obvious bug in the code is that this line:
throw new Exception('API Error: ' + $decodedResponse['error']);
should be:
throw new Exception('API Error: ' . $decodedResponse['error']);
Instead of the +, there should be a . for concatenating strings. After that correction, you should see the exception text correctly. However the real problem is why the exception is thrown in the first place, which is probably (due to the if (isset($decodedResponse['error']))) an error retrieved from the server, or the decoding/parsing fails for some reason.
However, there is no answer to why is this happening, because the problem is inside the library, not in the code you posted.