Topic: Dashboard Formatting Issues

I am having an issue with the dashboard module.  I am using FA 2.3.25 on my system right now.  The creator of the module made some modifications for me a year or so back and I can't find his contact info to ask him this question.

Anyways, when I am using the reminders, if I time a really long message as a new reminder, instead of text wrapping it just continues off the screen.  How do I fix this?

I am trying to put a screen shot on here but I am not sure how.  Here's a link to the screen shot I took.

https://drive.google.com/file/d/0B6yNa5 … sp=sharing

Post's attachments

FrontDashboardIssue.jpg 126.8 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Dashboard Formatting Issues

Looks like the css should have wrap enabled (nowrap disabled).

Since you are using a customised dashboard, you will need to first see what differences there are between the original and your customised one when the customisation was done. The original one itself may have had the bugs and then got rectified in the mainstream itself. It is possible that the customisation may have been done in the core files as well.

The original Dashboard theme and extension are available in my repo.

3 (edited by myhandgunpursedotcom 05/31/2017 11:16:56 pm)

Re: Dashboard Formatting Issues

apmuthu wrote:

Looks like the css should have wrap enabled (nowrap disabled).

Since you are using a customised dashboard, you will need to first see what differences there are between the original and your customised one when the customisation was done. The original one itself may have had the bugs and then got rectified in the mainstream itself. It is possible that the customisation may have been done in the core files as well.

The original Dashboard theme and extension are available in my repo.

Ok, where would I find this.  The customization that was done was only adding 2 different reports to show up and that was created by the author of this module.

I just ran a compare plugin to check everything and the css file is identical to the one in your repo.  Checked the widget codes along with all the rest of the basic files with this theme and module..  I think I'll try uninstalling it and reinstalling.  maybe something will correct it's self there.

Re: Dashboard Formatting Issues

OK, when I go to my main company to uninstall this module and theme everything it working perfect.  It's when I go into one of my other company files that it doesn't format right.  What may be causing that it to only effect all my other companies and not the main company file?

Re: Dashboard Formatting Issues

Never mind, the formatting is still messed up in the main company file as well.  I just had started new lines just to keep the message from running off the screen.

Re: Dashboard Formatting Issues

Ok, I have removed all my customization, it was only 2 additional widgets that were added and the problem still exists with the original module and theme.  I have tired playing with the css file all day today and every change I made in the css file didn't make any change in the theme at all.  Maybe I am working with the wrong css file.  I was trying to edit default.css in the dashboard theme file.  At this point I am at a complete lost.  Please help smile

7 (edited by myhandgunpursedotcom 06/01/2017 04:03:37 am)

Re: Dashboard Formatting Issues

Oh my, I am persistent if nothing else.  I found where the issue was coming from!

In file /modules/dashboard/widgets/reminders.php

Original code at line 67

 label_cell("<pre>".$myrow["description"]."</pre>",$extra);

Removed

 "<pre>"

and

"</pre>"

so it is now changed to

label_cell($myrow["description"], $extra);

I also had to make the same change at line 95 to /modules/dashboard/widgets/reminders_setup.php

Re: Dashboard Formatting Issues

A screenshot of how it now appears would be useful.

The pre tag should have the same effect. What browser and version are you using?
If the description has malicious code, it could compromise the output.

The pre tag also exists in the core code (from lines in FA 2.3):

Line 1379: includes/ui/ui_view.php
Line  57: includes/db/connect_db.inc

Re: Dashboard Formatting Issues

apmuthu wrote:

A screenshot of how it now appears would be useful.

The pre tag should have the same effect. What browser and version are you using?
If the description has malicious code, it could compromise the output.

The pre tag also exists in the core code (from lines in FA 2.3):

Line 1379: includes/ui/ui_view.php
Line  57: includes/db/connect_db.inc

Here is the screenshot of how it appears after I removed the code that was causing the problem.
https://drive.google.com/open?id=0B6yNa5cxS_7HV2xnR3JTTUN1MU0

I am using Chrome Version 59.0.3071.104 (Official Build) (64-bit)

As you can see from the text that was used as my sample text, there isn't anything in there other than just a message, no random code used.

Not sure why the pre was causing the problem but once it was removed from that part of the code it formatted correctly. I think it has to do with how it was placed in the code in the quotation marks?   That's been the only area where I have had issues with the formatting.

Post's attachments

Dashboard_Reminders.png 169.3 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Dashboard Formatting Issues

The pre tag is a security measure to avoid malicious / unintended html constructs and possible php escapes.

Somewhere the nowrap has been set and needs to be removed out of the css classes "reminder_overdue, reminder_due, reminder" that is in $extra or some inheritance.

Hope you have installed the dashboard theme and edited the default.css there by removing the erroneous last "*/" as per this commit.

There are several instances of white-space: nowrap; in the dashboard theme's default css file (as in all other themes) that may have got inherited suffers defaults.

https://www.w3schools.com/cssref/css3_pr_word-wrap.asp
https://www.w3schools.com/cssref/css3_pr_flex-wrap.asp
https://www.w3schools.com/cssref/css3_pr_text-wrap.asp
https://stackoverflow.com/questions/3949762/how-to-wrap-text-using-css
http://www.xanthir.com/b4U10

The better option if you cannot control user input, it is to establish the css property, overflow:hidden, so if the string is superior to the width, it will not deform the design.

The following should work everywhere:

<div style="word-wrap: break-word; width: 100px"> gdfggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg</div>