Closed conturNDE closed 8 years ago
Hi there,
Exactly the same issue with Release 2015-08-10 "Detritus".
Tried the same steps also:
Greets, Denis
+1
Hi wols, Hi conturNDE,
Could you find a workaround ?
I'm desperately looking for a fix :/.
Thanks ...
[Mon Aug 17 04:44:30.703006 2015] [:error] [pid 19259] [client x.x.x.x:61969] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/dokuwiki/lib/plugins/ditaa/syntax.php on line 105, referer: http://x.x.x.x/dokuwiki/doku.php
I'd also like to mention I'm seeing the same problem.
I have not found a work-around yet.
I found what I think is a workable solution. The cachename for each image seems to be based on an MD5 hash of the scale, antialias, edgesep, round and shadow settings on a given image. This does not make that cachename unique if the content is different and "settings" for a given ditaa image are the same.
The content for a given ditaa is already captured in its own MD5 hash, and simply adding the content MD5 to the cachename seems to resolve the issue to make each image have a unique cachename.
To add the content MD5 hash to the image hash, make the following change to syntax.php:
function _prepareData($input)
{
$output = array();
foreach( $input as $key => $value ) {
switch ($key) {
case 'scale':
case 'antialias':
case 'edgesep':
case 'round':
case 'shadow':
case 'md5': //<- Add to allow ditaa content MD5 hash to be part of image hash
$output[$key] = $value;
};
}
ksort($output);
return $output;
}
Hi to everyone,
Tested on two different instances of Dokuwiki (Release 2014-09-29d "Hrun") on two different servers. The behaviour is the same. We use the Ditaa-Plugin in version "ditaa 1.0" (should be the newest one).
We have on several pages some ditaa diagrams. But on all the pages for all the different diagrams the same picture is shown. The URL of the picture
If I tested ditaa manually (
java -jar ditaa0_9.jar bla.txt
) the created diagram is the correct one.The HTML source code shows different references for different images, but the images containing the same content. for example:
<img src="/DokuWiki/lib/exe/fetch.php?ditaa=4549692fc86f4f52f6735adca8124feb&media=maichingen:elkstack" class="media" alt=""/>
<img src="/DokuWiki/lib/exe/fetch.php?ditaa=392071c83cf37617488739ad3ab56cbf&media=maichingen:elkstack" class="media" alt=""/>
<img src="/DokuWiki/lib/exe/fetch.php?ditaa=884be4cc1fc44ad2275e3116327dc668&media=maichingen:elkstack" class="media" alt=""/>
The only "*ditaa.png"-file I found at cache:
/var/www/DokuWiki/data/cache/1/1ca35f68b30b7478c3a0855ac1a73b58.ditaa.png
the corresponding/var/www/DokuWiki/data/cache/1/1ca35f68b30b7478c3a0855ac1a73b58.ditaa.txt
shows the content of a total different diagram.Things I tryed:
~~NOCACHE~~
" to prevent from caching -> still the sameGreets, Andreas