Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Following implementation of #13992, it was no longer possible for administrators to define a custom default avatar, as Mantis forced use of Gravatar's 'identicon'. This commit reintroduces that functionality, and allows use of either one of Gravatar's default images or a custom one (identified by an URL), through appropriate configuration of $g_show_avatar. Fixes #14032
- Loading branch information
Showing
4 changed files
with
67 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f710546
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After upgrading old installations with setting $g_show_avatar = ON; will still work, but it's random behavior (seems that gravatar just ignores parameter ?d=1)
Did you check that mixed types (int|string) are working also with database configuration (adm_config_report.php)?
I had a short look and found only one other setting which uses mixed types ($g_limit_email_domain)
I prefer the simpler old approach to have to separate customization options for it.
f710546
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @atrol
As usual, many thanks for your careful and thorough review :)
I was actually thinking about the very same thing last night, and am in fact finalizing a patch to address exactly that, i.e. avoid regression when using legacy configuration (if ON, then Mantis will use the "identicon" default)
In my tests, behavior is not random, and d=1 is not ignored by Gravatar, it just uses the default "rotated G" image. Did you notice something different ?
Yes I did, and found no issues with that
Both have their advantages - here we have one single config controlling everything in a rather simple and straightforward manner, which has the added benefit of reducing the number of global variables.
f710546
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed - see fd20db7
f710546
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With "ignored" I meant that
http://www.gravatar.com/avatar/00000000000000000000000000000000 and
http://www.gravatar.com/avatar/00000000000000000000000000000000?d=1
are producing the same result (the rotated G image)
With "random behavior" I meant that the behavior is not documented.
It's just the re-engineered reproducible way it works at the moment.
You can't expect that d=1 produces the rotated G.
Maybe Gravatar will change the implementation and d=1 will generate
an error bitmap in future versions.
Possibly the better word for it is accidental and not random?
I agree,
I wrote because most of the MantisBT code is not using this coding style and
probably because I am not experienced in untyped programming languages and dealing
with === and !== .
I am quite sure that a lot of developers that started with typed languages
have their problems with it.
I am a bit aware of type problems since the following fix
3cca927
That's why I don't like dynamic or mixed typing.
Thanks