Topic-icon Create Post Button Not Working

Active Subscriptions:

None
7 years 2 months ago #60974 by webdevtim
When I select an article, and then "Create Post in the bottom left hand corner, All the happens is the "Loading" panel pops up and the stripped bar animates but nothing happens.

In "Social Media" I have the "Article - K2 - Item [OpenGraph plugin disabled]" because I am adding the tags by hand and the K2 OpenGraph plugin was causing a second set of tags to be added to the head section of the page causing the wrong content to get loaded in the post to Facebook and Twitter. I think I want this disabled until such time as K2 adds additional options to their plugin.

Autotune completes Site Check is all green, Error Check all pass.

If I login with user test account I can use the Share, Like Tweet, and G+ buttons and they work without issue.

Page Tab Canvas Works and I can operate the website from Facebook.

What am I missing here. I will continue to search for the answer, but I thought you might be able to direct me exactly to where I need to go in a few words.
The topic has been locked.
Support Specialist
7 years 1 month ago #61005 by alzander
To narrow things down quickly, you'll want to open the browser tools and go to the Network tab. Then, click the "Create Post" button. You should see a link show up in the network area like:
/index.php?option=com_jfbconnect&task=ajax.fetch&library=toolbar.button.post&subtask=getHtml&xyz=1
Right click on that link and do "Open in new tab". It should open a black & white text page that starts with:
{"target":"#social-post-container","title":"Post to social networks","html":"....
If that loads without problems (no error messages, weirdness, etc), that means that JFBConnect is working right in the code. In that case, there's probably a Javascript conflict on the page that may show up in the Console area of the browser tools.

Let us know where you see problems and we'll gladly help investigate more.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
7 years 1 month ago #61006 by webdevtim
This is what I got from the FireBug console.
GET https://911tap.org/plugins/system/jcemediabox/themes/standard/tooltip.html 304 Not Modified - 374ms  - jcemedi...3c5280e (line 1)

This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://developer.mozilla.org/docs/Mozilla/Performance/ScrollLinkedEffects for further details and to join the discussion on related tools and features!

GET https://www.911tap.org/index.php?option=com_jfbco...btask=getHtml&c3a83d15a96c9c169a33b5397af6a9a7=1 - 301 Moved Permanently - 	357ms - 2e8a542...413d.js (line 1)

Headers
Response Headers

CF-RAY - 3378027a686953d2-LAX
Cache-Control - max-age=0
Content-Type - text/html; charset=iso-8859-1
Date - Mon, 27 Feb 2017 01:54:35 GMT
Expires - Mon, 27 Feb 2017 01:54:35 GMT
Location - https://911tap.org/index.php?option=com_jfbconnect&task=ajax.fetch&library=toolbar.button.post&subtask
=getHtml&c3a83d15a96c9c169a33b5397af6a9a7=1
Server - cloudflare-nginx
Set-Cookie - __cfduid=d6cd4db0001da6519741755ce562b872b1488160475; expires=Tue, 27-Feb-18 01:54:35 GMT; path=/; domain=.911tap.org; HttpOnly
Vary - Accept-Encoding
X-Firefox-Spdy - h2

Request Headers

Accept - */*
Accept-Encoding - gzip, deflate, br
Accept-Language - en-US,en;q=0.5
Host - www.911tap.org
Origin - https://911tap.org
Referer - https://911tap.org/
User-Agent - Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0

! Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.911tap.org/index.php?option=com_jfbconnect&task=ajax.fetch&library=toolbar.button.post&subtask=getHtml&c3a83d15a96c9c169a33b5397af6a9a7=1. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Results from entering URL in Browser.

{"target":"#social-post-container","title":"Post to social networks","html":"
\n
\n

Please enter a comment and select the social networks to post to.<\/p>\n <\/textarea>\n          <br\/><input type=\"checkbox\" id=\"channels_selectall\" onclick=\"\n          jfbcJQuery('#social-post-popup :checkbox').each(function() {\n             if(this.id != 'channels_selectall')\n                this.checked = jfbcJQuery('#channels_selectall').is(':checked');\n             });\n          \"\/><label for=\"channels_selectall\">Select All<\/label><br\/>\n          <input type=\"checkbox\" name=\"cids[]\" class=\"twitter-stream\" value=\"5\" id=\"cid_5\" \/>\n                <label class=\"channel-name\" for=\"cid_5\">\n                    <img src=\"https:\/\/www.911tap.org\/media\/sourcecoast\/images\/provider\/twitter\/icon.png\" \/>9\/11 Truth Action Project Twitter Channe<\/label> <span class=\"social-post-counter\" data-max=\"140\" data-url-length=\"23\"><\/span><br\/><input type=\"checkbox\" name=\"cids[]\" class=\"facebook-page\" value=\"6\" id=\"cid_6\" \/>\n                <label class=\"channel-name\" for=\"cid_6\">\n                    <img src=\"https:\/\/www.911tap.org\/media\/sourcecoast\/images\/provider\/facebook\/icon.png\" \/>9\/11 Truth Action Project Facebook Chann<\/label><input type=\"hidden\" name=\"c3a83d15a96c9c169a33b5397af6a9a7\" value=\"1\" \/><\/form>\n              <\/div>","buttons":[{"name":"Post","id":"submit-social-post","action":"jfbc.toolbar.post.submit"}]}
The topic has been locked.
Support Specialist
7 years 1 month ago #61021 by alzander
This is the problem:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
The site you're viewing is non-www. The page that's trying to be loaded for the popup uses www. That could be a caching issue or a mis-configuration of various things. Essentially though, your browser thinks that some other website is requesting that file and blocking it because the domains don't match.

You can do any of the following to likely fix things:
* Visit the site over www so the popup is loaded over the same domain
* Check your firewall settings on the server to not add the Cross-Origin Request Restrictions

I hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
7 years 1 month ago #61025 by webdevtim
Thanks Alex, we changed the underlying domain from 911truthoutreach.org to 911tap.org and I have had to sort out a variety of issues that introduced. It may be the way I set up the regex in the redirect area of the .htaccess file in order to catch any variant of www.911tap.org, like 911tap.org/…

I will also look at what I set for the canonical name of the site in the zone file. We use CloudFlare so I will make sure that the zone file on CloudFlare and our hosting account match.

I will also look in the crossdomain.xml file and to make sure there isn't anything in there that needs to be changed over.

But thanks, I have been really busy over the last week and haven't been able to get back to this, so I really appreciate you taking the time to look at it and point me in the right direction.

How often am I able to post a review on the JED, because if enough time has elapsed since my last review, I need to post a new one to tell everyone how thorough you support is.
The topic has been locked.
Support Specialist
7 years 1 month ago #61042 by alzander
No problem for the help, as always. The cross-domain restrictions in browsers can be a bear to work around, but they are there for very good security reasons. It's really a matter of looking at the HTML of your page and searching for the domain name that's in the URL bar. All resources you see should use the same domain name (including http(s) and www/non-www) or, better yet, use only relative links.

If the domain is different than what's in the address bar, you'll likely run into some security issues because the browser thinks the current site is loading content from another site and the browser treats any content like that as untrusted.

I'm unsure how often you can leave a review. If you happen to try, let me know what happens! :)

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
7 years 1 month ago - 7 years 1 month ago #61051 by webdevtim
Still hunting this down.

I looked in .htaccess and what I did was decided to make our URL shorter by removing the www:
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule .* https://%1%{REQUEST_URI} [R=301,L]/

This says if the url contains www. then rewrite that URL as https://%{HTTP_HOST}%{REQUEST_URI} which in my case would come out as 911tap.org/…, not what I want. So I changed this to:
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

Which gives me www.911tap.org/…, which is what I do want.

I had to change all hte other permutations of this as well.

I also use redj and the regex I employ there is along the lines:
(https\:\/\/)?(www\.)?911tap.org/petition-now/?$

Which is fine because it says if the uri has http or https or www. or no www. plus ends with 911tap.org/petition-now rewrite this to www.911tap.org/petition/ which is the part contained in the other text box of the redj rewrite rule.

Do you suppose that this will create a problem as well? Perhaps just change the alias for this to just "petition " instead of "petition-now" and then get rid of the redirect?

Just to let you know, that solved the problem, everything works fine, but I haven't tested the petition yet.
Last edit: 7 years 1 month ago by webdevtim.
The topic has been locked.
Support Specialist
7 years 1 month ago #61066 by alzander
(https\:\/\/)?(www\.)?911tap.org/petition-now/?$
That's ok, but if you're trying to do a redirect, a more readable way is usually just:
Redirect 301 /old-path /new-path
That way, it doesn't matter about the domain at all, just the relative path for the link that you want to redirect.

Everything else seems fine and glad you got it going!

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
7 years 1 month ago - 7 years 1 month ago #61071 by webdevtim
Yeh I suppose you are right. I wanted to make sure that if it was https:// or http:// with or with out the www. that it would still go to www.911tap.org/petitions. So thanks for this little heads up.

Anyway everything is working fine and Mel just gave me a heads up on how to provide a separate image for twitter posts as well as how to add videos, so that will make things even nicer.

As always, thanks for providing the faster than lightning assistance. I can imagine what it must be like to get the amount of requests you get every day.
Last edit: 7 years 1 month ago by webdevtim.
The topic has been locked.
Support Specialist
7 years 1 month ago #61079 by alzander

Yeh I suppose you are right. I wanted to make sure that if it was https:// or http:// with or with out the www. that it would still go to ...

The first bit of code you have for fixing www and http(s) already does that. It redirects the user to the proper fully-qualified domain. Then, the rule for the path would be done again after the redirection occurs. The way you're doing it above wouldn't ever do anything extra because by the time the path check is executed, the domain has to be correct first.

Glad to help, as always. Let us know if you need anything else.

Thanks,
Alex
The topic has been locked.