Hyperlinks visited not changing color, 2.4, Formal White

Hyperlinks visited not changing color, 2.4, Formal White

by Rick Jerz -
Number of replies: 16
Picture of Particularly helpful Moodlers Picture of Testers

I just upgraded to Moodle 2.4, and I am running Formal White theme.  I have the following CSS code in Custom CSS:

a:link { color: #990000;}
a:visited { color: #cc6666;}

In Moodle 2.3, when I visited a hyperlink, the color would appropriately change (to cc6666).  Now, in Moodle 2.4, the hyperlink color does not change.  However, this only happens in the main topics area.  In my RSS feed block, for example, visited hyperlinks do change!  So I am wondering if I need to revise the a:visited code, or if this might be a problem with the Collapsed_Topics add-in, which I am also using.

Mary (or others) any thoughts?

Average of ratings: -
In reply to Rick Jerz

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
In reply to Mary Evans

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Mary,  this did not do it.

As I experimented, here is what I learned.  Some activities, such as assignments, quizzes, and forums, behave correctly.  It was my URL resources that were not honoring the "visited" link changes.  Then, I explored a little further and found that if a URL link was opened in a "New Window", the link did not change to show that it was visited.  However, if the URL was set to "Automatic", the visited link did change color!  Wow!

So I really think that the problem has something to do with the most recent fix to my MDL-37015.  I think whatever the coders did to fix the problem to MDL-37015, they forgot to honor the "visited" link feature.

What do you think? 

In reply to Rick Jerz

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Rick,

Are you sure that is the correct tracker ticket number, as the changes there are nothing related to a:links. You can see the comparison between the old code and the new here.

https://github.com/rajeshtaneja/moodle/compare/master...wip-mdl-37015

With regards all these anchor hyperlink pseudo selectors a:link, a:visited, a:hover, a:active, a:focus, all these can be overridden by your browser (Firefox select= Tools > Options > Content > Colors) Originally Formal White theme followed the Base theme which, if you check it out, does not set any anchor link colors. So if you change your browser to use really bright colors, you will see where Moodle stops and your browser takes over. I have mine always set to Pink & Purple for this reason.

As I said in my last comment, you need to trawl through all the Formal White CSS to see if there are some more a:links or just 'a' alone that have colors set which are still overriding these links.

If your assumption is correct, the only way to find out is try reversing the changes made in MDL-37015. To do this you would need access to the server, unless you have a copy of this version of Moodle on your localhost server?

I can't see that being the reason, but then again one can never tell with Moodle.

HTH

Mary

In reply to Mary Evans

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Yes, I really think that it is related to MDL37015 because only "pop-ups" and "New Window" URL links were problematic, and recently fixed.  And now, only those links are not showing that they have been visited.  All other links are working fine.

I posted my observation back into MDL37015 and I will wait to see how the developers respond to it.

I'll keep you posted.

In reply to Rick Jerz

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

I don't think it is related, I think it is more to do with the way Moodle is styled.But I will conceed defeat if I am proved wrong!

Try this...

http a:link,body a:link{color: red;}
http a:visited,body a:visited { color: green}

and I will guarantee it works!

In reply to Mary Evans

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Mary, I put your code into my Formal White, purged the cache, went back into the course, and the problem is still there.  You will see in my graphic that your "green" css kicked in, and what I am trying to show you is that I clicked on the "syllabus" link, which is set to open in a new window, which it did, but you will notice that the "syllabus" link did not change to green.  You should also see how many of the other non-URL-New Window resources and activities have changed to green.

What do you think?

Attachment Link Color Problem.jpg
In reply to Rick Jerz

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Mary, I thought I would add one more graphic.  I changed the "syllabus" link to display "Automatic", clicked on it, then went back into the course, and the color changed to green.  So when the URL resource is set to "Automatic", the link changes color, when set to "New Window", they don't change color.

What is interesting is that if I change it back to "New Window", the link retains the green color.  Somehow, Moodle is retaining some kind of information that this link was visited.  My guess is that a value is set in the database to something like "1" when a link is visited.  Probably the new code to make the "New Window" behave correctly forgot to set this database value to 1, just a small oversight.  If I set the URL resource to "Automatic", the value get set to 1 and remains at 1, even if I change the display back to "New Window".  This is correct behaviour, the link really was visited.  Hope some of this makes sense to you.

 

Attachment Automatic.jpg
In reply to Rick Jerz

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

HAPPY NEW YEAR!

CHEERS

OK...at least it is working with the CSS, however, I believe the it is your browser that remembers if you visited a website or not, or rather the cookies do. So considering that Cookies have changed recently, and also the fact that you are opening a new window, you are in effect creating another cookie that is seperate from the original page. 

I need to check this out on an older version of Moodle to see if the changes you maintain have caused the a:visited link to change, then there may be something the DEVs can do to change this.  It maywell be a DB value of 0 or 1 that is being missed, but again I doubt it.

Anyway...looks like you have stumbled on something that does need looking at.

It's too late for me now...but I will take a look at this when I have more time.

Good night

Mary

In reply to Rick Jerz

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

I have just seen this as I posted my previous comment to your other comment!

What happens if you refresh the window you launced the link from? Technically your browser should have recorded that link has been clicked (visted).

In reply to Mary Evans

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

A refresh doesn't help.  I thought about that too.

Here's more information.  I opened my course from Safari, a browser that I seldom use.  I did this with your CSS code.  Ok, every link is shown in red, as they initially should be.  Now I click on a link that opens with "New Window".  I return to the course page, even refresh Safari, and the link is still red.  Then, I click on a link that opens with "Automatic".  As expected, the link goes green.

You might be right that it might have something to do with the browser's cookies, I am not sure.  Nevertheless, there is some miscommunication between Moodle and the browser.

By the way Mary, Happy New Year!  I am in Colorado right now on a ski trip, and of course, squeezing in a little work.

In reply to Mary Evans

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Mary, the problem might be a little broader.  Go to my moodle webpage at www.rjerz.com/moodle.  Click on any "information" icon (to the right of a course), then click on either the syllabus or assignments link.  This opens up the syllabus or assignments using a "new_page".  Repeat this process and see if your browser shows that link as being visited.  Mine does not!

Depending upon how the developers fixed the URL Resource "New Window" feature, the problems that I am uncovering could be directly related.

In reply to Rick Jerz

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Rick,

This is getting to be really strange behaviour. However, it's not new and I still don't think it is a Moodle only probelm, as there is nothing in that code for the Pop-up that would be causing this, as it is a browser History thing. To prove my point I actially found an old discussion on a similar topic on BugZilla from 2004!

https://bugzilla.mozilla.org/show_bug.cgi?id=48578

In reply to Mary Evans

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I agree, strange!  I decided to make a short video showing the problem, and showing that the problem does not exist in Moodle 2.3.+.  However, what I learned is that the problem DOES exist in 2.3+.  This behavior does not seem to be a Firefox problem.  I just tried what I did in my video in Chrome, and got the very same results.

Do you think I should post this as a problem in the Moodle Tracker as a new bug?

Video: New Window link not showing a visited

 

In reply to Rick Jerz

Re: Hyperlinks visited not changing color, 2.4, Formal White

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Did you set up a Moodle tracker to track this bug?  It could well be in the way the New Window code has been written.