Tazzios / pdfviewer

joomla content plugin for pdf files
GNU General Public License v3.0
10 stars 4 forks source link

J4 pdfimage viewer is not working #26

Closed Tazzios closed 1 year ago

Tazzios commented 1 year ago

This line does not work in J4 https://github.com/Tazzios/pdfviewer/blob/ba70dd5084c3656478d38a0d96d319b275bd67b0/content_plugin/pdfviewer.php#L423

Here is the J3 documentation of it, but i cannot find a similar example for J4. https://docs.joomla.org/Categories_and_CategoryNodes_API_Guide#CategoryNode_Properties

If any one knows let me know.

Maybe there is a solution with sql and recursive? th example that i could find work the other way from parent cat to al children: http://perspective.altervista.org/index.php/resources/sql-server/56-recursive-loop-in-parent-child-relations

Tazzios commented 1 year ago

created this code which works standalone but needs some conversion and cleanup to get in working in the php code.

with recursive n as ( select id, parent_id, concat('/', alias ,'/') as path from josmf_jdownloads_categories where parent_id = 0 union all select c.id, c.parent_id, concat(n.path, c.alias, '/') from n join josmf_jdownloads_categories c on c.parent_id = n.id where n.path not like concat('%/', c.id, '/%') -- cycle pruning here! ) select Replace(path,'/ROOT','') from n inner join josmf_jdownloads_files as file ON n.id=file.catid where file.id=6;

Tazzios commented 1 year ago

fixed with v1.3.1