Hi everyone,
I start to use JoomDOC, and I try the plugin of JoomDOC (Editors-xtd - JoomDOC) to add JoomDOC link into my articles.
I had an error "Fatal error: Call to undefined method JoomDOCFile::getPaths()".
I had this error because I was on this page :
localhost/joomla/administrator/index.php...;path=FOLDERfile.pdf
This is in the backend part, and the application have to work on the frontend part. This is the first bug.
I make some to modifications to the component to solve this first bug.
I go to the file
administrator/components/com_joomdoc/views/documents/tmpl/modal.php.
I modify the around the line 80 :
if (JString::strpos($url, $prefix) === 0) {
$url = JString::substr($url, $prefixLength);
}
by this (I just had an else condition)
if (JString::strpos($url, $prefix) === 0) { // Si la position du préfixe dans l'url est = à 0
$url = JString::substr($url, $prefixLength); // alors on enlève le préfixe
} else {
$url = substr_replace($url, "/", JString::strpos($url, $prefix), $prefixLength);
}
But there was an other error, the URL was not good. She should be like that :
localhost/joomla/administrator/index.php...=documents&path=FOLDER\file.pdf et she was like that
localhost/joomla/administrator/index.php...;path=FOLDERfile.pdf
So I modifiate the line :
echo '<a href="javascript:window.parent.jSelectJoomdocDocument(\'' . $id . '\', \'' . $title . '\', \'' . $url . '\')" class="hasTip addDocument" title="' . $this->getTooltip('JOOMDOC_SET_DOCUMENT') . '"></a>';
by
echo '<a href="javascript:window.parent.jSelectJoomdocDocument(\'' . $id . '\', \'' . addslashes($title) . '\', \'' . addslashes($url) . '\')" class="hasTip addDocument" title="' . $this->getTooltip('JOOMDOC_SET_DOCUMENT') . '"></a>';
I hope it can help someone ...
Note : I'm a french guy, sorry for the mistakes english