@@ -79,23 +79,40 @@ public function convert(Doku_Event $event, $param) {
7979 . $ title ;
8080 $ cache = new cache ($ cachekey , '.dw2.pdf ' );
8181
82- $ mediafiles = array ();
82+ $ dependencies = array ();
8383 foreach ($ this ->list as $ pageid ) {
84- $ mediainuse = p_get_metadata ($ pageid , 'relation media ' );
85- if (is_array ($ mediainuse )) {
86- foreach ($ mediainuse as $ mediaid => $ exists ) {
87- if ($ exists ) {
88- $ mediafiles [] = mediaFN ($ mediaid );
84+ $ relations = p_get_metadata ($ pageid , 'relation ' );
85+
86+ if (is_array ($ relations )) {
87+ if (array_key_exists ('media ' , $ relations ) && is_array ($ relations ['media ' ])) {
88+ foreach ($ relations ['media ' ] as $ mediaid => $ exists ) {
89+ if ($ exists ) {
90+ $ dependencies [] = mediaFN ($ mediaid );
91+ }
92+ }
93+ }
94+
95+ if (array_key_exists ('haspart ' , $ relations ) && is_array ($ relations ['haspart ' ])) {
96+ foreach ($ relations ['haspart ' ] as $ part_pageid => $ exists ) {
97+ if ($ exists ) {
98+ $ dependencies [] = wikiFN ($ part_pageid );
99+ }
89100 }
90101 }
91102 }
103+
104+ $ dependencies [] = metaFN ($ pageid ,'.meta ' );
92105 }
93106
94107 $ depends ['files ' ] = array_map ('wikiFN ' , $ this ->list );
95108 $ depends ['files ' ][] = __FILE__ ;
96109 $ depends ['files ' ][] = dirname (__FILE__ ) . '/renderer.php ' ;
97110 $ depends ['files ' ][] = dirname (__FILE__ ) . '/mpdf/mpdf.php ' ;
98- $ depends ['files ' ] = array_merge ($ depends ['files ' ], $ mediafiles , getConfigFiles ('main ' ));
111+ $ depends ['files ' ] = array_merge (
112+ $ depends ['files ' ],
113+ $ dependencies ,
114+ getConfigFiles ('main ' )
115+ );
99116
100117 // hard work only when no cache available
101118 if (!$ this ->getConf ('usecache ' ) || !$ cache ->useCache ($ depends )) {
0 commit comments