Dump to file is unstyled

91 views
Skip to first unread message

Seb Duggan

unread,
Mar 31, 2016, 3:38:41 AM3/31/16
to Lucee
I'm seeing an issue where if I do a dump to a file (HTML format), the resulting data is unstyled. This is in Lucee 5, but I saw the same issue in 4.5.

Looking at the source of the output, the CSS implies that the content will all be contained in a div with a random 4-char id (e.g. div#xoop). However, the content is not wrapped in this div.

If I edit the dumped file to add in the div and id, it displays using the expected styling...

Geoff Parkhurst

unread,
Mar 31, 2016, 5:49:19 AM3/31/16
to lu...@googlegroups.com
Something in your main stylesheet overriding the dump styles?

I've occasionally seen dump output squashed into a tiny column - but
that's generally been our doing. I've never seen it entirely
un-styled.

The id of the wrapping div is not referenced in the inline styles (or
JS for that matter) - but the class (in my case -lucee-dump modern)
is.
> --
> Love Lucee? Become a supporter and be part of the Lucee project today! -
> http://lucee.org/supporters/become-a-supporter.html
> ---
> You received this message because you are subscribed to the Google Groups
> "Lucee" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lucee+un...@googlegroups.com.
> To post to this group, send email to lu...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lucee/6098ce88-5c1b-45b2-a746-34a2e13b8e19%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Seb Duggan

unread,
Mar 31, 2016, 10:20:25 AM3/31/16
to Lucee
This is dumping to a file using the output attribute, so there are no other styles to conflict with.

This is the inline style block in the file:

<style type="text/css">
div#xqgh table {font-family:Verdana, Geneva, Arial, Helvetica, sans-serif; font-size:11px; empty-cells:show; color:#000; border-collapse:collapse;}
div#xqgh td {border:1px solid #000; vertical-align:top; padding:2px; empty-cells:show;}
div#xqgh td span {font-weight:bold;}
div#xqgh td.n0 {color:#333399;border-color:#333399;background-color:#ccf;}
div#xqgh td.h0 {color:#333399;border-color:#333399;background-color:#99f;}
div#xqgh td.n1 {color:#990000;border-color:#990000;background-color:#fc9;}
div#xqgh td.h1 {color:#990000;border-color:#990000;background-color:#f60;}
div#xqgh td.n2 {color:#002340;border-color:#002340;background-color:#dee3e9;}
div#xqgh td.h2 {color:#002340;border-color:#002340;background-color:#6289a3;}
</style>

Paul Klinkenberg

unread,
Apr 2, 2016, 6:15:59 PM4/2/16
to lu...@googlegroups.com
Hi Seb,

One great thing about opensource, is that you can look into the source :)
function doOutput( attrib, meta, context, caller  ) {
   var dumpID = createId();
   var hasReference = structKeyExists( arguments.meta,'hasReference' ) && arguments.meta.hasReference;
   var result = this[ arguments.attrib.format ]( arguments.meta, arguments.context, arguments.attrib.expand, arguments.attrib.output, hasReference, 0, dumpID );
   // sleep( 5000 );  // simulate long process to test async=true
   if (arguments.attrib.output EQ "browser") {
      echo(variables.NEWLINE & '<!-- ==start== dump #now()# format: #arguments.attrib.format# -->' & variables.NEWLINE);
      echo('<div id="#dumpID#" class="-lucee-dump">#result#</div>' & variables.NEWLINE);
      echo('<!-- ==stop== dump -->' & variables.NEWLINE);
   }
   else if (arguments.attrib.output EQ "console") {
      systemOutput(result,true);
   }
   else {
      file action="write" addnewline="yes" file="#arguments.attrib.output#" output="#result#";
   }
}
What you will probably see in the snippet above, is the fact that the div is only outputted  if (arguments.attrib.output EQ "browser"

Hopefully the change will be pulled in shortly: https://github.com/lucee/Lucee/pull/18

Kind regards,

Paul Klinkenberg


Reply all
Reply to author
Forward
0 new messages