ElkArte Community

Elk Development => Bug Reports => Topic started by: radu81 on May 03, 2018, 12:06:16 am

Title: Custom Message icon not visible
Post by: radu81 on May 03, 2018, 12:06:16 am
I add a new icon 18x18 camera.png in /themes/default/images/post. I can set this new icon with a new entry Video in the menu and i can choose this Message Icon when i write a post... but after the post is submited the icon is not display in my replie ! All the others icons works fine but there are all the default icons.

Not sure I understand well, the icon is visible when you start a new topic but not on replies? Could be a bug, I'll try to replicate this on a test forum.

I'd say it's a bug and here is what I noticed: 
- I created a new custom icon called mobile (I used a copy of one existing image file renaming it to mobile.png)
X
- when opening a new topic or posting a reply you can choose the custom icon from dropdown but it is not displayed in topic view. If you try to edit the post using the complete editor (More -> Edit) you will get the same result, custom icon displayed in editor but not visible in topic view
X X
- strange is if I use the Quick Edit option I see the default icon instead of my custom icon. Changing the icon from Quick edit works and icon is visible after edit.
X X

Title: Re: Custom Message icon not visible
Post by: augras on May 03, 2018, 10:38:59 am
Hi,
You are right : it's exactly the problem.
Philippe

EDIT1
The probem is for a new topic or a reply. An example :


Philippe
Title: Re: Custom Message icon not visible
Post by: Spuds on May 04, 2018, 04:20:20 pm
This appears to be caused by MessageTopicIcons.class.php not loading in the custom icons, it only loads in the known default ones.  I have a fix proposal that I'll place on github for review.
Title: Re: Custom Message icon not visible
Post by: Spuds on May 04, 2018, 04:33:24 pm
My proposal for review ... https://github.com/Spuds/Elkarte/commit/c5983054e54da453ed2d868e7b67d61db1009645
Title: Re: Custom Message icon not visible
Post by: augras on May 04, 2018, 05:14:14 pm
Hi Spuds,
Thank you to try to solve this bug.
I don't understand what to do with the files in github ! I must just take these files and replace the same on a test forum ?
Philippe
Title: Re: Custom Message icon not visible
Post by: Spuds on May 04, 2018, 05:25:23 pm
If you want to test, you would take this (https://raw.githubusercontent.com/Spuds/Elkarte/c5983054e54da453ed2d868e7b67d61db1009645/sources/subs/MessageTopicIcons.class.php) version of MessageTopicIcons.class.php and replace sources/subs/MessageTopicIcons.class.php

You would then have to edit the file sources/subs/TopicUtil.class.php

Code: (find) [Select]
		$icon_sources = new MessageTopicIcons(!empty($modSettings['messageIconChecks_enable']), $settings['theme_dir']);
Code: (replace) [Select]
		$icon_sources = new MessageTopicIcons(!empty($modSettings['messageIconChecks_enable']), $settings['theme_dir'], $topics_info);

But not this is just a proposal at this point, there may be a better fix ;)
Title: Re: Custom Message icon not visible
Post by: ahrasis on May 05, 2018, 02:58:30 am
This issue should be tracked so hopefully it can be fixed before 1.1.4 is released.
Title: Re: Custom Message icon not visible
Post by: augras on May 05, 2018, 10:23:28 am
But not this is just a proposal at this point, there may be a better fix ;)
Hi Spuds,
Your proposal is in test but nothing change : the new icon is stil not display after submit, but if i edit my message the icon is here.
Philippe
Title: Re: Custom Message icon not visible
Post by: Spuds on May 05, 2018, 02:49:00 pm
What I did fixed the icon not displaying correctly in the topic listing.   Unfortunately is a different error than the one being discussed here!

I've been looking into the error discussed above, and while doing that, I've found yet another issue with them!  Hope to have a proper fix for all of these issues soon.
Title: Re: Custom Message icon not visible
Post by: augras on May 05, 2018, 03:19:33 pm
Thank you Spuds ! :D
Philippe
Title: Re: Custom Message icon not visible
Post by: Spuds on May 05, 2018, 10:03:32 pm
Use this file (https://raw.githubusercontent.com/elkarte/Elkarte/388d21fd69cfe529518b0863296f62947a01ad2e/sources/subs/MessageTopicIcons.class.php) and replace sources/subs/MessageTopicIcons.class.php

That should fix one more of the issues ...
Title: Re: Custom Message icon not visible
Post by: augras on May 06, 2018, 10:24:00 am
A great thank you Spuds !
It works fine.
I would to clic to a like button but no Like button is display ! I can see somme Likes made by other users but buttons for me.
Philippe
Title: Re: Custom Message icon not visible
Post by: augras on February 01, 2021, 05:46:15 pm
Hi,
i'm back with the same problem !
I just installed the 1.1.7 package from 1.1.6 and the problem with the icon come back.
I had an error on the MessageTopicIcons.class.php to update to 1.1.7 and just now i understand it is because i changed the file to resolve an another problem !
Maybe is it possible to fix this bug in the 1.1.7 package ?
I let the bug like this for now.
Philippe
Title: Re: Custom Message icon not visible
Post by: Spuds on February 03, 2021, 02:54:20 am
I'll have to get into my wayback machine and see what I fixed the first time !

Could you describe what you are doing so I can fix this properly?  I made some 1.1.7 changes so that the default message icons now use SVG images, and only if you enable custom message icons will you see the non default ones.  Disabling custom message icons should also prevent former custom ones from showing.
Title: Re: Custom Message icon not visible
Post by: augras on February 03, 2021, 01:00:59 pm
Use this file (https://raw.githubusercontent.com/elkarte/Elkarte/388d21fd69cfe529518b0863296f62947a01ad2e/sources/subs/MessageTopicIcons.class.php) and replace sources/subs/MessageTopicIcons.class.php

That should fix one more of the issues ...

3 years ago to solve this problem i just replaced the file by yours.
Is it what you need ?
Title: Re: Custom Message icon not visible
Post by: Spuds on February 03, 2021, 03:18:50 pm
No, don't do that ... its an old file.

I can't remember what I was doing last night so I was just trying to get a fresh recap of the issue since there have been several releases of the software been then and 1.1.7 .
Title: Re: Custom Message icon not visible
Post by: augras on February 03, 2021, 04:22:53 pm
Sorry, the issue is exaclty the same as decribe here :
- I created a new custom icon called mobile (I used a copy of one existing image file renaming it to mobile.png)
[attach type=thumb]5772[/attach]
- when opening a new topic or posting a reply you can choose the custom icon from dropdown but it is not displayed in topic view. If you try to edit the post using the complete editor (More -> Edit) you will get the same result, custom icon displayed in editor but not visible in topic view
[attach type=thumb]5774[/attach] [attach type=thumb]5776[/attach]

Not sure for this part :
- strange is if I use the Quick Edit option I see the default icon instead of my custom icon. Changing the icon from Quick edit works and icon is visible after edit.
[attach type=thumb]5778[/attach] [attach type=thumb]5780[/attach]
Title: Re: Custom Message icon not visible
Post by: radu81 on February 03, 2021, 11:51:49 pm
I remember about this bug, but I cannot reproduce it anymore using a clean install (1.1.6 + 1.1.7 test package installed)

=== edit ===
@augras‍ make sure you have "Enable customized message icons" option enabled in ACP -> Forum -> Smileys and Message Icons -> Settings
Title: Re: Custom Message icon not visible
Post by: augras on February 04, 2021, 08:42:00 am
Yes i am :
X
Title: Re: Custom Message icon not visible
Post by: Spuds on February 05, 2021, 02:33:45 am
If you are using a custom theme, please make sure these edits were done to that themes files (if they exist)

https://github.com/elkarte/Elkarte/commit/c668fa60744879f7947e836bd315a61268a24b17#diff-dcfd7cf1887d24cc8182ce7dd59975c5780ef6a3853f4452cdd04dddf2861940
Title: Re: Custom Message icon not visible
Post by: augras on February 05, 2021, 06:37:02 pm
Thank you Spuds.
I use Elkarte Light with no changes, or i don't remember (but i really don't think).
I take a look to the files and comme back.
Title: Re: Custom Message icon not visible
Post by: augras on February 06, 2021, 12:34:39 pm
If you are using a custom theme, please make sure these edits were done to that themes files (if they exist)

https://github.com/elkarte/Elkarte/commit/c668fa60744879f7947e836bd315a61268a24b17#diff-dcfd7cf1887d24cc8182ce7dd59975c5780ef6a3853f4452cdd04dddf2861940
It's ok : the 2 files are in 1.1.7 and all the modifications are here.
Title: Re: Custom Message icon not visible
Post by: augras on February 07, 2021, 11:58:44 am
I mean the code was already in the files but it still doesn't work.
I'm on hollidays for the week but i will test on a fresh install at my back.
Title: Re: Custom Message icon not visible
Post by: Spuds on February 07, 2021, 03:37:41 pm
OK please report back. 

I noticed you are using Flarum style on your site so there could be a small compatibility issue with that and 1.1.7 but I have not checked into that.

Have a great time off.
Title: Re: Custom Message icon not visible
Post by: augras on February 18, 2021, 02:03:59 pm
Hi,
On a fresh 1.1.6+1.1.7 elkarte :
after Enable customized message icons i added a camera.png with Video entry... i can choose this in the message but still standard icon displayed.
Flarum style works fine with 1.1.7 and in flarum page the camera icon is corretly displayed !
Title: Re: Custom Message icon not visible
Post by: augras on February 18, 2021, 02:11:45 pm
With Elkarte light theme : doesn't work
X


With Flarum : it works
X

It's the same thing on my old Elkarte and the fresh one.
Title: Re: Custom Message icon not visible
Post by: Spuds on February 18, 2021, 10:22:51 pm
Don't you hate when you know you tested something to make sure it worked, and then it does not !  Darn I know I tested that, off to look at what I mussed up.
Title: Re: Custom Message icon not visible
Post by: Spuds on February 18, 2021, 10:44:36 pm
I believe I found the error.

In file /sources/subs/MessageTopicIcons.class.php

Code: (find) [Select]
				return $element['name'];
Code: (replace) [Select]
				return $element['value'];

Please give that a try and let me know if it fixes it for you.
Title: Re: Custom Message icon not visible
Post by: augras on February 19, 2021, 09:51:10 am
Don't you hate when you know you tested something to make sure it worked, and then it does not !  Darn I know I tested that, off to look at what I mussed up.
Don't worry, i'm here to remeber that to you !  ;)

But you finally won !
X

Thank you again,
philippe
Title: Re: Custom Message icon not visible
Post by: radu81 on February 19, 2021, 01:14:19 pm
Don't you hate when you know you tested something to make sure it worked, and then it does not !  Darn I know I tested that, off to look at what I mussed up.

I know something:
I remember about this bug, but I cannot reproduce it anymore using a clean install (1.1.6 + 1.1.7 test package installed)
O:-) O:-) 

glad it is solved now!