Permalink
Browse files

Set 'version' attribute as required in initJS tag

  • Loading branch information...
benorama committed Jun 23, 2014
1 parent 456becd commit daf2140da7b2ebbdc876be0023fc7c300a21663b
@@ -25,6 +25,7 @@ class FacebookJSTagLib {
* Initialize Facebook JS SDK
*
* @attr appId REQUIRED
+ * @attr version REQUIRED (API v1.0 for app created before April 30th, 2014, API v2.0 for the others)
* @attr autoGrow (Default to false)
* @attr channel (Default to true)
* @attr customSelector (Default to '$')
@@ -34,7 +35,6 @@ class FacebookJSTagLib {
* @attr locale (Default to server locale)
* @attr status (Default to false)
* @attr xfbml (Default to false)
- * @attr version (Default to '', API v1.0 for app created before April 30th, 2014, API v2.0 for the others)
*/
def initJS = { attrs, body ->
if (!attrs.locale) attrs.locale = RequestContextUtils.getLocale(request)
@@ -12,7 +12,7 @@
window.fbAsyncInit = function() {
FB.init({
appId: "${appId}",
- <g:if test="${version}">version: "${version}", // API version</g:if>
+ version: "${version}", // API version
<g:if test="${channelUrl}">channelUrl: "${channelUrl}", // Custom channel URL</g:if>
cookie: <g:if test="${cookie}">true</g:if><g:else>false</g:else>, // enable cookies to allow the server to access the session
oauth: true, // enables OAuth 2.0
@@ -20,6 +20,7 @@ h3. Attributes
Required attribute is :
* @appId@ Facebook app id
+* @version@ API version (API @v1.0@ for app created before April 30th, 2014, API @v2.0@ for the others.
Optional attributes are :
* @autoGrow@ Call @FB.setAutoGrow()@ after page rendering (default to @false@).
@@ -29,5 +30,4 @@ Optional attributes are :
* @locale@ Define JS SDK locale (default to server locale).
* @status@ Check login status (default to @false@).
* @xfbml@ Parse XFBML (default to @false@).
-* @version@ API version (default to @''@, API @v1.0@ for app created before April 30th, 2014, API @v2.0@ for the others.

3 comments on commit daf2140

@PatrickHuetter

This comment has been minimized.

Show comment Hide comment
@PatrickHuetter

PatrickHuetter Jun 24, 2014

Contributor

Does this fix the problems with "Uncaught Error: init not called with valid version" ? I get this message only in production environment on my server. Offline everything is working.

Contributor

PatrickHuetter replied Jun 24, 2014

Does this fix the problems with "Uncaught Error: init not called with valid version" ? I get this message only in production environment on my server. Offline everything is working.

@PatrickHuetter

This comment has been minimized.

Show comment Hide comment
@PatrickHuetter

PatrickHuetter Jun 24, 2014

Contributor

Yes it does (tested it).

Contributor

PatrickHuetter replied Jun 24, 2014

Yes it does (tested it).

@benorama

This comment has been minimized.

Show comment Hide comment
@benorama

benorama Jun 24, 2014

Owner

Indeed, to be backward compatible between Graph V1.0 et V2.0, you need to specify the version.

Owner

benorama replied Jun 24, 2014

Indeed, to be backward compatible between Graph V1.0 et V2.0, you need to specify the version.

Please sign in to comment.