By Altitudes on Saturday, 11 July 2015
Posted in Technical Issues
Likes 0
Views 1.1K
Votes 0
Hello

I'm using sh404SEF and for the SEF URL communaute/photos/image-1 I have the following non-SEF URLs (what sh404SEF calls "duplicates"):
index.php?option=com_easysocial&Itemid=520&id=1580&lang=fr&layout=download&view=photos
index.php?option=com_easysocial&Itemid=520&id=1580&lang=fr&layout=form&view=photos
index.php?option=com_easysocial&Itemid=520&id=1609&lang=fr&layout=item&view=photos
index.php?option=com_easysocial&Itemid=520&id=1610&lang=fr&layout=item&view=photos
index.php?option=com_easysocial&Itemid=520&id=1609&lang=fr&layout=download&view=photos

So of course when the communaute/photos/image-1 is requested the user hardly ever gets what he expected

All of the images (for the different IDs) are named image.jpg. What you should have in the URL in that case is either image-1 for the 1st image, image-2 for the 2d one etc. or maybe 1580-image, 1609-image etc. where the number is the ID of the image. I don't know what are you best practices.
And of course, the layout parameter which differs here between the different non-SEF URLS should be somehow in the SEF URL...

Thanks!
Hey Altitudes,

I am really sorry for the delay of this reply as it is a weekend for us here. Hm, by right these urls should all have a unique url of it's own. Can you try downloading the attached file and upload it into /components/com_easysocial/sef_ext/ and see if the problem still persists?

P/S: You need to purge the cache in SH404 (This is why i hate SH404 and developing plugins for SH404) This is actually one of the reasons I hate debugging with Sh404 too
·
Sunday, 12 July 2015 23:41
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello

Yes, I don't know why it's not possible to purge the file/memory cache from backend. But you can disable it in the sh404SEF configuration for testing purposes.

After deleting SEF URLs and purging cache, I was able generate the following duplicates for communaute/photos/image-1:
index.php?option=com_easysocial&Itemid=520&id=1804&lang=fr&layout=item&view=photos
index.php?option=com_easysocial&Itemid=520&id=1703&lang=fr&layout=item&view=photos
index.php?option=com_easysocial&Itemid=520&id=1704&lang=fr&layout=item&view=photos
which means that something is wrong.

Also, in photos.php you added
$title[] = $layout;
where I think that something like this was expected (to have a localized URL):
addLayout( $title, $view , $layout );

And you did this for download layout, it seems to be required for form layout too (see my initial message).
·
Monday, 13 July 2015 01:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Altitudes,

I am sorry for the delay of this reply.

Can you download the attachment below and place it inside your /components/com_easysocial/sef_ext/ folder and purge the sh404sef url and see how it goes?
·
Tuesday, 14 July 2015 13:19
·
0 Likes
·
0 Votes
·
0 Comments
·
It seems much better but as I wrote before:

Also, in photos.php you added
$title[] = $layout;
where I think that something like this was expected (to have a localized URL):
addLayout( $title, $view , $layout );

You also have this kind of issue in albums.php where you will find:
if (isset($type)) {
$title[] = $type;
so that type cannot be localized...

Thanks
·
Tuesday, 14 July 2015 20:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, I am not really sure if I understand you here but I don't see such codes on the albums.php . Are we talking about the same file in /components/com_easysocial/sef_ext/albums.php ?
·
Wednesday, 15 July 2015 00:08
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, line 27 of /components/com_easysocial/sef_ext/albums.php (ES 1.3.29) for the 2d part of my message. For the 1st part of my message, this is in photos.php.
·
Wednesday, 15 July 2015 00:20
·
0 Likes
·
0 Votes
·
0 Comments
·
At line 28, there's an assignment of $type and I don't see why this should be "localized"?
·
Wednesday, 15 July 2015 01:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Because type can be either user, event or group... and all this is English
·
Wednesday, 15 July 2015 02:26
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Altitudes,

I am sorry for the delay of this reply.

Can you download both attachment and place it inside your /components/com_easysocial/sef_ext/ folder and then add the following string inside your language file,
COM_EASYSOCIAL_SH404_PHOTOS_LAYOUT_DOWNLOAD="download"
COM_EASYSOCIAL_SH404_PHOTOS_LAYOUT_FORM="form"
COM_EASYSOCIAL_SH404_PHOTOS_LAYOUT_ITEM="item"
COM_EASYSOCIAL_SH404_ALBUMS_TYPE_EVENT="event"
COM_EASYSOCIAL_SH404_ALBUMS_TYPE_GROUP="group"
COM_EASYSOCIAL_SH404_ALBUMS_TYPE_USER="user"
COM_EASYSOCIAL_SH404_PHOTOS_TYPE_EVENT="event"
COM_EASYSOCIAL_SH404_PHOTOS_TYPE_GROUP="group"
COM_EASYSOCIAL_SH404_PHOTOS_TYPE_USER="user"

Remember to purge your sh404sef url after the change.

Hopefully these could resolve the issue and I will add this for the next release of easysocial.
·
Wednesday, 15 July 2015 13:04
·
0 Likes
·
0 Votes
·
0 Comments
·
OK, but... I don't understand why you don't use the addLayout( $title, $view , $layout ) function, that will reuse existing strings (defined for ES router) for layout. Maybe I missed something?

For the other strings (*_TYPE_*), there does not seem to be any existing ones, so yes indeed, they need to be defined for sh404SEF especially.
·
Thursday, 16 July 2015 04:56
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Altitutes,

I am sorry for the late reply,

The reason why we didn't use addLayout() is because this function removes the layout from the url. But right now we currently dealing with type and we want to remove type from the url. So we can't use addLayout() function. Screenshot: http://screencast.com/t/JaQq4YZGE . You can find this addLayout() function here for further understanding: /components/com_easysocial/sef_ext/common.php .

Hope this explains and have a nice day.
·
Thursday, 16 July 2015 17:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello

I am talking of this portion of code (in photos.php):

	if (isset ($layout)) {

$title[] = JString::ucwords(JText::_('COM_EASYSOCIAL_SH404_PHOTOS_LAYOUT_' . strtoupper($layout)));

shRemoveFromGETVarsList( 'layout' );
}
·
Thursday, 16 July 2015 20:06
·
0 Likes
·
0 Votes
·
0 Comments
·
We'll update it accordingly.
·
Saturday, 18 July 2015 17:53
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post