facebook feed page plugin error: Uncaught SyntaxError: Unexpected token ':' - facebook

I am trying to display a simple facebook feed on a website using page plugin
But I keep getting the following error. Does anyone know what it means? and perhaps any way to resolve it?
Uncaught SyntaxError: Unexpected token ':'
at a (f1ExCm8DHSA.js?_nc_x=Ij3Wp8lg5Kz:254:358)
at a.c._inlineJS (f1ExCm8DHSA.js?_nc_x=Ij3Wp8lg5Kz:255:1551)
at b (f1ExCm8DHSA.js?_nc_x=Ij3Wp8lg5Kz:255:1002)
at xyCIQCGmYe4.js?_nc_x=Ij3Wp8lg5Kz:14:3616
at Array.forEach (<anonymous>)
at j (xyCIQCGmYe4.js?_nc_x=Ij3Wp8lg5Kz:14:3596)
at Object.appendContent (xyCIQCGmYe4.js?_nc_x=Ij3Wp8lg5Kz:14:2032)
at Object.setContent (xyCIQCGmYe4.js?_nc_x=Ij3Wp8lg5Kz:14:1880)
at b.<anonymous> (Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:39:2329)
at ug (Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:59:58919)
at Sj (Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:59:118576)
at Rj (Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:59:118136)
at Qj (Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:59:117671)
at Ok (Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:59:127937)
at Nk (Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:59:127252)
at Ak (Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:59:123724)
at Wf (Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:59:52973)
at tk (Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:59:120748)
at Object.enqueueSetState (Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:59:59325)
at b.a.setState (Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:58:1753)
at Miz6oWqAvcL.js?_nc_x=Ij3Wp8lg5Kz:39:2237
at AsyncRequest._dispatchResponse (x9ZrO_yAkJs.js?_nc_x=Ij3Wp8lg5Kz:16:6351)
at Object.applyWithGuard (f1ExCm8DHSA.js?_nc_x=Ij3Wp8lg5Kz:58:9980)
at AsyncRequest.c (f1ExCm8DHSA.js?_nc_x=Ij3Wp8lg5Kz:58:10684)
at x9ZrO_yAkJs.js?_nc_x=Ij3Wp8lg5Kz:15:84
at e (f1ExCm8DHSA.js?_nc_x=Ij3Wp8lg5Kz:322:291)
at Object.applyWithGuard (f1ExCm8DHSA.js?_nc_x=Ij3Wp8lg5Kz:58:9980)
at d (f1ExCm8DHSA.js?_nc_x=Ij3Wp8lg5Kz:296:2252)

I was having this problem too and much like most responses, I was cracking my brain figuring where is the problem coming from. The source in console didn't really have any errors, but yet it reported as error.
After some detailed testing, I realized that if I include the timeline parameter in the tabs section, then I get this error. As soon as I removed it, the error disappeared. Probably the semicolon is coming from the feed or something. Might help someone else having this problem.

Related

mysqli_query($conn, $sql) On adding this, giving an error of 500 INTERNAL SERVER ERROR, No detailed error shown [duplicate]

In my local/development environment, the MySQLi query is performing OK. However, when I upload it on my web host environment, I get this error:
Fatal error: Call to a member function bind_param() on a non-object in...
Here is the code:
global $mysqli;
$stmt = $mysqli->prepare("SELECT id, description FROM tbl_page_answer_category WHERE cur_own_id = ?");
$stmt->bind_param('i', $cur_id);
$stmt->execute();
$stmt->bind_result($uid, $desc);
To check my query, I tried to execute the query via control panel phpMyAdmin and the result is OK.
TL;DR
Always have mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); in your mysqli connection code and always check the PHP errors.
Always replace every PHP variable in the SQL query with a question mark, and execute the query using prepared statement. It will help to avoid syntax errors of all sorts.
Explanation
Sometimes your MySQLi code produces an error like mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given..., Call to a member function bind_param()... or similar. Or even without any error, but the query doesn't work all the same. It means that your query failed to execute.
Every time a query fails, MySQL has an error message that explains the reason. In the older PHP versions such errors weren't transferred to PHP, and all you'd get is a cryptic error message mentioned above. Hence it is very important to configure PHP and MySQLi to report MySQL errors to you. And once you get the error message, fixing it will be a piece of cake.
How to get the error message in MySQLi
First of all, always have this line before MySQLi connect in all your environments:
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
After that, all MySQL errors will be transferred into PHP exceptions. An uncaught exception, in turn, makes a PHP fatal error. Thus, in case of a MySQL error, you'll get a conventional PHP error. That will instantly make you aware of the error cause. And the stack trace will lead you to the exact spot where the error occurred.
How to get the error message from PHP
Here is a gist of my article on PHP error reporting:
Reporting errors on a development and live servers must be different. On the development server it is convenient to have errors shown on-screen, but on a live server error messages must be logged instead, so you could find them in the error log later.
Therefore, you must set corresponding configuration options to the following values:
On a development server
error_reporting should be set to E_ALL value;
log_errors should be set to 1 (it is convenient to have logs on a development PC too)
display_errors should be set to 1
On a production server
error_reporting should be set to E_ALL value;
log_errors should be set to 1
display_errors should be set to 0
After that, when MySQL query fails, you will get a PHP error that explains the reason. On a live server, in order to get the error message, you'll have to check the error log.
In case of AJAX call, on a dev server open DevTools (F12), then Network tab. Then initiate the request which result you want to see, and it will appear in the Network tab. Click on it and then the Response tab. There you will see the exact output. On a live server check the error log.
How to actually use it
Just remove any code that checks for the error manually, all those or die(), if ($result), try..catch and such. Simply write your database interaction code right away:
$stmt = $this->con->prepare("INSERT INTO table(name, quantity) VALUES (?,?)");
$stmt->bind_param("si", $name, $quantity);
$stmt->execute();
Again, without any conditions around. If an error occurs, it will be treated like any other error in your code. For example, on a development PC it will just appear on-screen, while on a live site it will be logged for the programmer, whereas for the user's convenience you could use an error handler (but that's a different story which is off topic for MySQLi, but you may read about it in the article linked above).
What to do with the error message you get
First of all you have to locate the problem query. The error message contains the file name and the line number of the exact spot where the error occurred. For the simple code that's enough, but if your code is using functions or classes you may need to follow the stack trace to locate the problem query.
After getting the error message, you have to read and comprehend it. It sounds too obvious if not condescending, but learners often overlook the fact that the error message is not just an alarm signal, but it actually contains a detailed explanation of the problem. And all you need is to read the error message and fix the issue.
Say, if it says that a particular table doesn't exist, you have to check spelling, typos, and letter case. Also you have to make sure that your PHP script connects to a correct database
Or, if it says there is an error in the SQL syntax, then you have to examine your SQL. And the problem spot is right before the query part cited in the error message.
If you don't understand the error message, try to google it. And when browsing the results, stick to answers that explain the error rather than bluntly give the solution. A solution may not work in your particular case, but the explanation will help you to understand the problem and make you able to fix the issue by yourself.
You have to also trust the error message. If it says that number of tokens doesn't match the number of bound variables then it is so. The same goes for the absent tables or columns. Given the choice, whether it's your own mistake or the error message is wrong, always stick to the former. Again it sounds condescending, but hundreds of questions on this very site prove this advise extremely useful.
A list of things you should never ever do in regard of error reporting
Never use an error suppression operator (#)! It makes a programmer unable read the error message and therefore unable to fix the error
Do not use die() or echo or any other function to print the error message on the screen unconditionally. PHP can report errors by itself and do it the right way depends on the environment - so just leave it for PHP.
Do not add a condition to test the query result manually (like if($result)). With error exceptions enabled such condition will just be useless.
Do not use the try..catch operator for echoing the error message. This operator should be used to perform some error handling, like a transaction rollback. But never use it just to report errors - as we learned above, PHP can already do it, the right way.
P.S.
Sometimes there is no error, but no results either. Then it means, there is no data in the database to match your criteria. In this case you have to admit this fact, even if you can swear the data and the criteria are all right. They are not. You have to check them again.
I've got an article that can help in this matter, How to debug database interactions. Although it is written for PDO, the principle is the same. Just follow those instructions step by step and either have your problem solved or have an answerable question for Stack Overflow.

Extbase, Uncaught TYPO3 Exception. Flush system cache solves is for a while

Site works fine. Suddenly it will through an error. When clicking "flush system cahce" the error will go away for a some time. Anything from minuttes to severaƦ hours.
Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1247602160:
Unknown column 'tx_my_domain_model_formular.rel_formular' in 'where
clause' |
TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\SqlErrorException
thrown in file
/webserver/typo3/src/6.2.15/typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php
in line 862.
It is correct that the columns does not exist. But how to preceed in finding the error after this? Where is the sql generated that causes the site to crash?
UPDATE
A check "myParentObj->getChildObj instanceof myChildObjClass" used to work just fine. After changing myParent model to lazy load the ChildObj, then the class of childObj changed from childObjClass to a lazyLoadClass... I am not sure but I guess that is in turns somewhere somehow caused the core error seen in the log.
How to investigate further I simply cannot work out. Eg. store all DB calls in a file og DB to analyze after the error occours.
First
Please take time to write a good question. For a good question you'll get a good answer. It doesn't have to be perfect (not everyone is a native english speaker) but please reread your question.
Answer
If all fields are defined correctly, just run a DB compare from within the installtool.
If not, you need to define the DB-fields in your extension correctly.
Is this your own extension? When doing the query that triggers the error you could call execute(true) to generate the actual SQL statement and debug from there.

Dropbox API v2 error message

When trying to get a delta result/cursor in the Java API:
client.files.listFolderBuilder(BASE_DIR).recursive(true).start();
I get the following error message:
com.dropbox.core.v2.DbxFiles$ListFolderException: Exception in list_folder: ListFolderError.{".tag":"path","path":{".tag":"other"}}
As far as I can tell it doesn't really say what is wrong. Any suggestions on what to do?
It seems that the reason was that my BASE_DIR ended with a slash. Removing the trailing slash of the path seems to have fixed the problem.

AEM 6 integration with Adobe Target problems

I am integratign AEM 6 with Adobe Target and have some problems with it.
Particularly, when I add "Adobe Target Mbox" component on the page - T&T request is sends but in console there is an error :
Uncaught TypeError: undefined is not a function.
I found that it throws when mboxOfferDefault.prototype.show(content) function is called from /etc/clientlibs/foundation/testandtarget/util/source/init.js.
The problem is that this function calls this.hide(content) which doesn't exists in mboxOfferDefault.prototype and that's why I suppose this error is thrown.
Can anyone tell me why this function in init.js is overriding default mboxOfferDefault.prototype.show(content) defined in mbox.js and what will be the risks if i'll remove this function from /etc/clientlibs/foundation/testandtarget/util/source/init.js ?
I will be appreciated if some one will help me with this problem.
Thanks!

if($bans[$i]['ip'] == $_SERVER['REMOTE_ADDR'])

i have created a website with Ultimate video curator using wordpress, also buy a plugin "wp sensei" for protect this site from hacking. I have also installed this plugin, but when i clicked on activate showing me
"Plugin could not be activated because it triggered a fatal error." and
"Warning: Illegal string offset 'ip' in /home4/worldvj5/public_html/halloweencostumes/wp-content/plugins/wp-sensei/wplockup.php on line 108
Warning: Illegal string offset 'time' in /home4/worldvj5/public_html/halloweencostumes/wp-content/plugins/wp-sensei/wplockup.php on line 119
Fatal error: Cannot unset string offsets in /home4/worldvj5/public_html/halloweencostumes/wp-content/plugins/wp-sensei/wplockup.php on line 120"
so what is the main problem, and how to solve it, please solve this problem.
and when i go to this page with 108 line in wp sensei, i see that "if($bans[$i]['ip'] == $_SERVER['REMOTE_ADDR'])"
please help me.
Odds are, the $bans array is empty. Add a bogus IP to be banned using the plugin, and then try it again.