Ticket #783 (closed defect: fixed)

Opened 13 months ago

Last modified 13 months ago

Filename inherited across code blocks in grabcode handler

Reported by: NilsLindenberg Owned by: DarTar
Priority: normal Milestone: 1.1.6.6
Component: formatters Version: 1.1.6.5
Severity: normal Keywords: grabcode 1.1.7-ported
Cc: DarTar

Description (last modified by DarTar) (diff)

As reported on WikkaBugs, there is a problem with the grabcode handler:

in 1.1.6.2 using a code block like this (A)

%%(cpp;;test.cpp)
#include <iostream>

int main() {
 std::cout <<"Hello World\n";
 return 0;
}
%%

followed by one like this (B)

%%
some rubbish
%%

when grabbing the second code block the filename is inherited from block A (test.cpp.txt or test.cpp, if corrected) instead of what you would expect (some default name eg codeblock.txt) ""

The problem occurs because the formatter uses the file name from the first example instead of the default one.

Suggested solution:

change:

static $valid_filename = '';

to

$valid_filename = '';

Change History

Changed 13 months ago by DarTar

  • keywords 1.1.7-unported added
  • owner changed from unassigned to DarTar
  • status changed from new to assigned
  • milestone changed from 1.1.7 to 1.1.6.6

Changed 13 months ago by DarTar

  • description modified (diff)

Changed 13 months ago by DarTar

  • summary changed from Wrong filename in grabcodehandler for a second codeblock on a page to Filename inherited across code blocks in grabcode handler

Changed 13 months ago by DarTar

  • status changed from assigned to closed
  • resolution set to fixed

(In [1161]) Preventing filename inheritance across multiple code blocks in grabcode handler, closes #783

Changed 13 months ago by DarTar

(In [1162]) Porting [1161] to trunk, refs #783

Changed 13 months ago by DarTar

  • keywords 1.1.7-ported added; 1.1.7-unported removed
Note: See TracTickets for help on using tickets.