Can't add hyperlinks in posts.

Found a bug? Tell us!!
Guest

Can't add hyperlinks in posts.

Post by Guest »

Hello,

I just have a quick question, which may or may not be bug related (hopefully it's just me not seeing a solution); When trying to create a new entry and adding a hyperlink, I am unable to write in the text fields in the new window. I can, however, just post the entry and afterwards edit it and click the link button - which then allows me to, not write in the fields, but paste the link in both of them. This seems a bit odd to me.

I'm using Firefox, by the way. With Explorer I'm able to write in the fields and all, but it apparently doesn't save the link. After clicking OK nothing happens :(

And another thing about the link button.. after clicking OK, shouldn't the new window close?

I'm a bit confused here, so any help would be very much appreciated!


Thanks in advance.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Can't add hyperlinks in posts.

Post by garvinhicking »

First we need to know which Serendipity version you're using. And I suppose you're using the WYSIWYG editor?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post by Guest »

My bad, sorry, I should've posted that info from the start. But yes, I'm using the WYSIWYG editor, and I'm running Serendipity v.0.7.1.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Can't add hyperlinks in posts.

Post by garvinhicking »

Hi!

Okay, it was a bug in htmlarea. I just upgraded to latest version of the tool and put it into CVS of Version 0.8

To apply the changes to 0.7 you need to:

1. Download the snapshot generated tomorrow of Serendipity 0.8
2. Copy the whole 'htmlarea' tree to your 0.7 installation
3. Edit the file serendipity_functions_entries.inc.php
4. Find the function "serendipity_emit_htmlarea_code". Search for this:

Code: Select all

    <script type="text/javascript" src="htmlarea/htmlarea.js"></script>
    <script type="text/javascript" src="htmlarea/dialog.js"></script>
and change it to this:

Code: Select all

    <script type="text/javascript" src="htmlarea/htmlarea.js"></script>
    <script type="text/javascript" src="htmlarea/lang/<?php echo WYSIWYG_LANG; ?>.js"></script>
    <script type="text/javascript" src="htmlarea/dialog.js"></script>
Then look further down the function and replace "insertorderedlist" with "orderedlist" and replace "insertunorderedlist" with "unorderedlist" (removing the 'insert' string portion).

Then you should be settled with a working installation.

Note that when inserting a Hyperlink you FIRST have to create the text inside your entry. Then you need to mark the text, click on the hyperlink icon and enter the target URL. So the text you entered previously will become the link description, otherwise you'd get an empty link.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post by Guest »

Wicked! It worked like a charm, except the file serendipity_functions_entries.inc.php is just called functions_entries.inc.php.

Thanks for your quick reply. You're doing an awesome job! :D
nocturno

Post by nocturno »

i had exactly the same problem, using firefox.

i did the fix and it worked..

But (there's always a but hehehe)
now if i post a new message it always adds the link for the second part of the message (from the bottom box of the WYSIWYG interface.)
When there's no text entered in that box.

i used the s9y_200501121337 htmlarea folder over an 0.71 installation and edited the file:

serendipity_functions.inc.php
from the serendipity rootdir
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

nocturno, thanks for reporting this!

Please edit your serendipity_functions.inc.php and find this code:

Code: Select all

    /* WYSIWYG-editor inserts empty '<br />' for extended body; this is reversed here */
    if (isset($entry['extended']) && trim($entry['extended']) == '<br />') {
        $entry['extended'] = '';
    }

    if (strlen($entry['extended'])) {
        $exflag = 1;
    }
and change it to this:

Code: Select all

    /* WYSIWYG-editor inserts empty '<br />' for extended body; this is reversed here */
    if (isset($entry['extended']) && trim($entry['extended']) == '') {
        $entry['extended'] = '';
    }

    if (strlen($entry['extended'])) {
        $exflag = 1;
    }
(Notice the changed trim()!)

And then please tell me if it works :)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

by making the first set of changes when i tried to make a new entry all i got was a lot of errors followed by the "EXTENDED BODY" text area only. The error were about a tool bar, could not create, etc.

They all seem to be stemming from your second recommendation:

Then look further down the function and replace "insertorderedlist" with "orderedlist" and replace "insertunorderedlist" with "unorderedlist" (removing the 'insert' string portion).

I'm using the : s9y_200501141338 snapshot.. should i be using a earlier?
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

BTW the only way i can stop the error and get the proper results is by re-doing what you suggested to change initially.

The problem still exists. I can not type in the hyper link window. I have to click ok, i get the error about no text entered in the box. only then i can enter my link, which attaches itself to the highlighted text before clicking the hyperlink button. When clicking OK .. the box doesnt close, i have to click cancel, but the link is still created to the text i highlighted.

I also have a iamge issue, that i will post in another thread.

Just to add i have also tried s9y_200501121337 snapshop htmlarea folder.. no change..

thank you.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Leonard, if you get those errors it means you did not copy the right 'htmlarea' directory from the snapshot over to your serendipity installation
[quote="leonardb"]BTW the only way i can stop the error and get the proper results is by re-doing what you suggested to change initially. Check your htmlarea/htmlarea.js file. It should be dated JAnuar 11th 16:00 and 80036 bytes large.

You may also need to reload/refresh your browser cache!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

garvinhicking wrote:Leonard, if you get those errors it means you did not copy the right 'htmlarea' directory from the snapshot over to your serendipity installation

Regards,
Garvin
There is only one htmlarea directory? how could i not upload the correct one? i copied the whole directory from

s9y_200501121337

and also tried

s9y_200501121338

thanks again..
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Did you compare filesizes? Did you drop your browsers cache?
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

dont understand the idea of comparing file sizes .. there is a single htmlarea folder.

i did the refresh, there are no errors, but now i do not get the WYSIWYG editor .. its like plain text only..

thanks again .. appreciate your efforts ..
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Leonard, even if you don't understand it, please tell me your filesize and date of htmlarea.js, so I can see if you really have the latest version and all its subfolders.

You need to have all the changes applied I mentioned in the previous post when you dropped your browser cache, because the new HTMLarea needs all of them. Please check your JavaScript Console to see if there are any errors?

And you still have WYSIWYG editor set to on in your Serendipity personal preferences/configuration?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

garvinhicking wrote:Leonard, even if you don't understand it, please tell me your filesize and date of htmlarea.js, so I can see if you really have the latest version and all its subfolders.

You need to have all the changes applied I mentioned in the previous post when you dropped your browser cache, because the new HTMLarea needs all of them. Please check your JavaScript Console to see if there are any errors?

And you still have WYSIWYG editor set to on in your Serendipity personal preferences/configuration?

Regards,
Garvin
Ok, sorry about that

i have tried again with s9y_200501141338 still the same thing..

All changes have been made at the time when doing the refresh.

the htmlarea file size is

Size: 522 KB (534,871 bytes)

Size on disk: 1.11 MB (1,171,456 bytes)

Contains: 199 files, 33 folders

HTH ..

thanks..

EDIT:
And you still have WYSIWYG editor set to on in your Serendipity personal preferences/configuration?

yes i do.. i also saved it again to endure the setting.
Post Reply