By Fagault Eric on Saturday, 13 October 2018
Posted in General Issues
Replies 20
Likes 0
Views 621
Votes 0
Hello,
When entering a URL in a workflow (At the time of creating a page for example), the absence of the protocol (http or https) causes an error when displaying the page, at the time of the click on the URL.
The error is: "The page does not exist".
What can be done so that you do not have to enter the URL with http or https?
Best regards.
Eric
Hey there,

I am really sorry for the delay of this reply as it is a weekend for us here.

Can you download my attached file and replace into this JoomlaFolder/media/com_easysocial/apps/fields/user/url/url.php and see how it goes.
·
Saturday, 13 October 2018 08:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,
Thank you for your reply.
I re-inserted the file, but it did not change anything.
When the protocol (http or https) is not specified, the url attempts to attach an article. (Id = 16)
/index.php?option=com_content&view=article&id=16
This article does not exist.
Best regards.
Eric
·
Saturday, 13 October 2018 13:26
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, if that is the case, you have to comment out those code from that file, you can refer at my attached screenshot below.
·
Sunday, 14 October 2018 12:32
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,
Thank you for your reply.

I commented on the lines as you ask me, but that did not change anything.
When I click on a URL where the protocol (http or https) has not been specified, the click points to a page 404.

Best regards.

Eric
·
Sunday, 14 October 2018 16:38
·
0 Likes
·
0 Votes
·
0 Comments
·
I tested this way:


if (stristr ($ value, 'http: //') === false && stristr ($ value, 'https: //') === false) {

$ scheme = "https: //";

$ value = $ scheme. $ Value;
}


There is always a 404 error in clicking on the URL.
·
Sunday, 14 October 2018 16:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Perhaps you can share with us how to replicate this on your site so I can better have a check?
·
Monday, 15 October 2018 10:08
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,
Of course.

This is the click on the link in the screen capture module, when we visit a page where the URL field is completed (The "EXTASIA" page for example)
https://www.web-libertins.com/page/167-club-l-extasia
The module is: mod_esapropospage

Best regards.
Eric
·
Monday, 15 October 2018 15:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Actually i still not get it which part is showing wrong URL, can you provide us some screenshot regarding this?
·
Monday, 15 October 2018 16:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes

When the protocol is not filled in the field.
·
Monday, 15 October 2018 16:24
·
0 Likes
·
0 Votes
·
0 Comments
·
It seems like you referring your custom module, I've applied some fix into your module, it should work fine now.
·
Monday, 15 October 2018 17:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks, but that adds https to the url.
If the administrator of the page already enters the protocol (http or https) this adds it again.
It can not work.
The idea to check if https or https is present in the string is good, and add it in case of absence is good, but that's what I can not operate.
Like this:


if (stristr ($value, 'http://') === false && stristr ($value, 'https://') === false) {

// Determine if the site support SSL
$uri = JURI :: getInstance ();
$scheme = $uri-> toString (array ('scheme'));

$value = $scheme. $Value;
}
·
Monday, 15 October 2018 18:29
·
0 Likes
·
0 Votes
·
0 Comments
·

Thanks, but that adds https to the url.
If the administrator of the page already enters the protocol (http or https) this adds it again.
It can not work.
The idea to check if https or https is present in the string is good, and add it in case of absence is good, but that's what I can not operate.
Like this:


if (stristr ($value, 'http://') === false && stristr ($value, 'https://') === false) {

// Determine if the site support SSL
$uri = JURI :: getInstance ();
$scheme = $uri-> toString (array ('scheme'));

$value = $scheme. $Value;
}


But that does not work properly
·
Monday, 15 October 2018 18:30
·
0 Likes
·
0 Votes
·
0 Comments
·
I finally did:


<?Php //Display or note display
if ($page->getFieldValue('URL') == "") {
$displayURL = "None";
}
else {
$displayURL = "";
};

//Detect protocole
$value = $page->getFieldValue ('URL');
if (stristr ($value, 'http: //') === false && stristr ($value, 'https: //') === false) {

// // Determine if the site support SSL
$uri = JURI::getInstance ();
$scheme = $uri->toString(array('scheme'));

// URL
$value = $scheme. $Value;
}
?>

<div class = "thisinfo" style = "color: # 333; font-size: 12px; display: <? php echo $displayURL;?>;">
<a href="<?php echo $value ;?> "target =" blank "class =" o-nav__link t-text - muted ">
<i class = "es-side-widget__icon fa fa-globe t-lg-mr - md"> </ i>
<?php echo $value; ?>
</a>
</ Div>


It works.

It works qaund the site is in https, by cons I'm not sure that:
// Determine if the site support SSL
$ uri = JURI :: getInstance ();
$ scheme = $ uri-> toString (array ('scheme'));
detects if the site supports SSL.

Best regards.

Eric
·
Monday, 15 October 2018 20:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Glad to heard you found the solution.
·
Monday, 15 October 2018 23:39
·
0 Likes
·
0 Votes
·
0 Comments
·
I did not find the solution because when the site is http, it does not work, what I did always adds https
·
Tuesday, 16 October 2018 00:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, actually that is no easy way to determine as what is that domain site is support SSL or not support SSL if the user only enter this domain (e.g. http://www.google.com , google.com) without protocol.
·
Tuesday, 16 October 2018 11:20
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post