By AUSSERRE DIDIER on Tuesday, 14 February 2017
Posted in Technical Issues
Replies 21
Likes 0
Views 249
Votes 0
Hello,

I'm trying to declare the API of Twitter, but impossible to save it ... see screenshots.

Bests regards
Didier A.
Hi Didier,
Can you provide us your backend, ftp and Twitter access at http://stackideas.com/dashboard/site so we can investigate this and help you set up Twitter integration on your site? Thanks.
·
Tuesday, 14 February 2017 11:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,
I finally succeeded, I had made a bad configuration.

On the other hand, I encountered a bug with the URL sent to TWITTER, via the back office when publishing an article, the URL is correct from the front-office:

The self-publication Twitter publishes this url: http://conseil360groupe.com/easyblog/offre-globale/test-article-twitter-2.html

While the url is: http://conseil360groupe.com/blog/offre-globale/test-article-twitter-2.html

I set the URLs as follows in Easyblog : http://yoursite.com/menu/category/title

Outside the alias and the name of the menu calling the blog's home page is "blog". In the urls there is "EasyBlog". Where can I change "EasyBlog" to "Blog"?

Thanks for your help
Didier A.
·
Thursday, 16 February 2017 04:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Didier,
I could not replicate your issue on my local instance. Can you make sure there are no similar menu items to 'blog', so that the system is not confused. And then try performing new autopost to Twitter from the blog. If the issue persists, we would need your site access to investigate this issue.
·
Thursday, 16 February 2017 17:44
·
0 Likes
·
0 Votes
·
0 Comments
·
First, thanks for your help

I want to keep "blog" and (sorry) not "EasyBlog". In the main menu, the menu item is "blog". The alias is "blog" (see screenshot A).

I have just done new tests, example
- The correct address is generated on the blog (see capture B).

blog/offre-globale/test-artcile-11.html

- The wrong address is generated in the emails of notifications (see capture C) and on Twitter.

easyblog/offre-globale/test-artcile-11.html


I use sh404SEF to generate urls and I realize that the example article generates two urls of the same article (bad duplication for the reference on Google) (see capture D/E). Normally sh404SEF is used to avoid this kind of problem but in this case, it does not take it into account!

So I think this is a bad setting between Easyblog and sh404SEF, but which one?

I recall that this bug only affects the back office. There is no problem if one creates and publishes an article from then the front-office.

For info, I had already made a post on this problem of compatibility between Easyblog and sh404SEF for another site that we admire and which one to an EasyBlog license also, there are improvements but visible there is still a bug: https://stackideas.com/forums/an-article-published-redirection-error-since-linkedin

Bests regards
Didier A.
·
Thursday, 16 February 2017 19:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey there,

Do you mean only happen when you submit the blog post from backend so those URL will become /easyblog instead of your current menu item alias /blog?

If yes, if I recall correctly from this thread (https://stackideas.com/forums/an-article-published-redirection-error-since-linkedin) our developer already added this following method into Easyblog core file to retrieve those SEF url submit post from backend :

Sh404sefHelperGeneral::getSefFromNonSef($nonSefUrl, $fullyQualified = true, $xhtml = false, $ssl = null)


It seems like still not working based on another customer reported this, then I found out this file
JoomlaFolder/administrator/components/com_sh404sef/sh404sef.class.php when it get the menu title from backend, it unable to find it for some reason based on the SH404SEF default code and I already asked that client try to report to Sh404sef developer regarding this, but until now that client didn't get back to us.

So can you try download my attached file and replace into this file location JoomlaFolder/administrator/components/com_sh404sef/sh404sef.class.php then try submit a new post from backend and see is it get correct URL?

I applied some hack on that file in order to retrieve those correct menu item alias, check my attached screenshot below.

Note : You must backup that file before you replace it and make sure you using this Sh404sef version 4.8.2.3492 or higher than that.
·
Friday, 17 February 2017 17:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

Yes but there is the creation of two urls:
- one with "blog" and found in the blog on the website
- the other with "easyblog" and found in emails and on Twitter "this address is false, because it does not correspond to the tree of the site.


So I did the test requested. There are improvements, but also new bugs:

The improvements :
- the url is normally written with "blog" in Twitter (see capture I)
- The url is normally written with "blog" on the website
- In sh404 SEF: there are 2 urls generated so the 1st catch for site reference (duplicate page seems to be well managed) (see capture F)

Bugs:
- I did not receive the emails of notification of publication of the article
- When I open the article on the website, it lacks all the other blocks in the slidebar on the right (see capture G), normally it should be (see capture H), but I found the bug!
Explanation:
With your fix, sh404 SEF seems to treat well the creation of urls, but do not take into account "the good" url:
He chose this url (see capture F):

index.php?option=com_easyblog&id=94&lang=fr&view=entry


While he should choose this url (see capture J):

index.php?option=com_easyblog&Itemid=148&id=94&lang=fr&view=entry


I manually changed url (yellow star) and now I can see the article correctly in the site created from the back office and published on twitter (see capture K). But in everyday life, you can not manage this choice manually, especially as the articles will be created by different people

Nota :
joomla 3.6.5
Easyblog : 5.0.43
sh404sef 4.8.2.3492
PhP 7

Bests regards
·
Friday, 17 February 2017 18:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey there,

I am sorry for the delay of this reply,

- I did not receive the emails of notification of publication of the article

Based on my testing, it seems like when submit a new blog post from backend, it hitting some of the error, can you try download my attached file and replace into this following file location and see how it goes?

This fix should send out the email notification to your site subscriber.

- When I open the article on the website, it lacks all the other blocks in the slidebar on the right (see capture G), normally it should be (see capture H), but I found the bug!

Regarding this, I was unable to figure out even i pass menu item id with the blog non-sef URL into this function "getSefFromNonSef", it still unable to detect and get that URL which contain the menu item id (screenshot : http://take.ms/I6zAq ), maybe I missed something so unable to make it work.


$itemId = EBR::getItemId('latest');
$itemId = '&Itemid=' . $itemId;
$url = 'index.php?option=com_easyblog&view=entry&id=' . $post->id . $itemId;

$link = Sh404sefHelperGeneral::getSefFromNonSef($url, true, true);


Perhaps you can consult with SH404sef developer regarding this?
·
Monday, 20 February 2017 17:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

No problem, I was also in weekend.

So I tested with the change and it's ok for email notifications. On the other hand always the same bug with the url.

I have also tested since the frond office. I created a new article and ok for notifications and ok for for url ...

I sent a request to the technical service of Sh404sef ... I await their answers and you transmit it

Bests regards
Didier A.
·
Monday, 20 February 2017 19:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Alright, keep us update then.
·
Monday, 20 February 2017 19:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Je vous transmets les informations obtenus par le service technique de Sh404Sef :


Regarding this, I was unable to figure out even i pass menu item id with the blog non-sef URL into this function "getSefFromNonSef", it still unable to detect and get that URL which contain the menu item id (screenshot : http://take.ms/I6zAq ), maybe I missed something so unable to make it work.


I can see on their screenshot that a bad URL (without an Itemid) is recorded first. That is the problem. They might call getSefFromNonSef() with the correct Itemid, but unfortunately, they also call it (or most likely call JRoute, the Joomla method, or use a Joomla method that use JRoute) before with a bad non-sef URL, without an Itemid.

The getSefFromNonSef() method from the backend works very fine, it's used for instance by AcyMailing and other, for this exact purpose. I would suggest they re-check their code, trying to see where JRoute is called prior to calling getSefFromNonSef().


To clarify what I said above, we do not "detect" the URL with an Itemid. We just record in the database the SEF URLs created for each non-sef URL passed to us by Joomla or other extensions. If multiple non-sef are transformed into the same SEF, they are duplicates and we record all of them in the order we received them. So the first one to be passed to us becomes the "main" URL.

In this example, something asked sh404SEF to transform index.php?option=com_easyblog&id=129&view=entry into a SEF URL before something else asked us to transform index.php?option=com_easyblog&id=129&Itemid=129&view=entry into a SEF.

NB: It might just be a coincidence, but I find it strange that the Itemid number and the entry number is the same, 129, in their example. Maybe it's just a small error in their testing?


I hope this information will help you to solve the bug ...
Didier A.
·
Monday, 20 February 2017 19:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks I will log this issue into our issue tracker, and I also will keep you update if we have some question related with Sh404sef extension.
·
Thursday, 23 February 2017 16:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Arlex,

Do not hesitate if I can be useful to you. It would be nice that EasyBlog and Sh404sef are fully compatible. In my opinion, two essential components for Joomla.

Thank you for keeping me informed ...

Best regards
Didier A.
·
Thursday, 23 February 2017 16:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Sure I will keep you updated then.
·
Thursday, 23 February 2017 23:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey there,

I've done some testing and verify this following statement in my locally :

To clarify what I said above, we do not "detect" the URL with an Itemid. We just record in the database the SEF URLs created for each non-sef URL passed to us by Joomla or other extensions. If multiple non-sef are transformed into the same SEF, they are duplicates and we record all of them in the order we received them. So the first one to be passed to us becomes the "main" URL.

You can take a look of the following how i test on this :
A. Test pass in a new blog post non-sef URL with menu item id from backend
1. Open this file JoomlaFolder/administrator/components/com_easyblog/views/blogs/view.html.php
2. Put this following code into the display() method :

Note : Regarding the id you have to use your site existing blog post ID
You can check this from backend blog listing page http://replaceYourDomainSite.com/administrator/index.php?option=com_easyblog&view=blogs


$url = 'index.php?option=com_easyblog&view=entry&id=48';
$tempURL = EBR::_($url, true, null, false, false, false);
$tempURL1 = str_ireplace('/administrator/', '/', $tempURL);

$tempURL2 = JRoute::_($tempURL1);

$final = Sh404sefHelperGeneral::getSefFromNonSef($tempURL2, true, true);

dump('here', $tempURL1, $tempURL2, $final);

3. Clear all the Easyblog extension SEF URL from backend Sh404sef page.
4. Then run this following page URL from BACKEND :
http://replaceYourDomainSite.com/administrator/index.php?option=com_easyblog&view=blogs

5. You will see this following result :
- Itemid 129 menu alias is 'blog'

string(4) "here"
string(57) "index.php?option=com_easyblog&view=entry&id=48&Itemid=129"
string(84) "/administrator/index.php?option=com_easyblog&view=entry&id=48&Itemid=129"
string(98) "http://eb5.com/administrator/index.php?option=com_easyblog&view=entry&id=48&Itemid=129";

The output is when we pass in non-sef URL with the Item id, Sh404sef will never generate to SEF URL.
And I also noticed when it pass through this getSefFromNonSef() method, it didn't store those URL in sh404sef database as well. I suspect this method detected if sh404sef database do not have these non-sef stored before, it unable to generate to SEF URL from backend.


B. Test those existing blog post already generated SEF URL in sh404sef from frontend
1. Open this file JoomlaFolder/components/com_easyblog/views/latest/view.html.php
2. Put this following code into the display() method :

Note : Regarding the id you have to use your site existing blog post ID
You can check this from backend blog listing page http://replaceYourDomainSite.com/administrator/index.php?option=com_easyblog&view=blogs


$url = 'index.php?option=com_easyblog&view=entry&id=48';
$tempURL = EBR::_($url, true, null, false, false, false);
$tempURL1 = str_ireplace('/administrator/', '/', $tempURL);

$tempURL2 = JRoute::_($tempURL1);

$final = Sh404sefHelperGeneral::getSefFromNonSef($tempURL2, true, true);

dump('here', $tempURL1, $tempURL2, $final);

3. Clear all the Easyblog extension SEF URL from backend Sh404sef page.
4. Then run this following page URL from FRONTEND :
http://replaceYourDomainSite.com/index.php?option=com_easyblog

5. You will get following result :
- Itemid 129 menu alias is 'blog'

string(4) "here"
string(57) "index.php?option=com_easyblog&view=entry&id=48&Itemid=129"
string(28) "/blog/48-final-test123123123"
string(42) "http://eb5.com/blog/48-final-test123123123"

Based on what my testing, It seems like Sh404sef never generate SEF URL from backend even pass through the JRoute, can you pass my testing and result to sh404sef developer regarding this and keep us update?
·
Monday, 20 March 2017 21:41
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Alex,

I'm back from leave. The site is in production now. So I will have to do the tests on a developer version.
Give me some time, to organize and I come back to you ...
·
Monday, 27 March 2017 14:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Alright, keep us updated then.
·
Monday, 27 March 2017 16:31
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Alex,


Sorry, I'm very busy right now. I do not forget to look at your last post ... I try this weekend, but I do not forget!
·
Monday, 10 April 2017 22:40
·
0 Likes
·
0 Votes
·
0 Comments
·
it okay, take your time.
·
Tuesday, 11 April 2017 16:43
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post