Howto setup permissions for plugins dir

Okay, I’m adding it on https://github.com/creecros/Customizer

It does not matter if you delete it before adding it, or the other way. PostgreSQL sequences will always increment (by default, or decrement if you change the stepping).

Also, do you have issues with other images, outside of the plugin, like Task Images?

I know jack about PostgreSQL. You could probably figure out the issue before me :stuck_out_tongue_winking_eye:

My suggestion: if you want to use fix identifiers, then do not specify a default value for the id column at all. Just use the fixed id values everywhere.

I’m quite good with PostgreSQL (blush), I might be able to look at the code at GitHub. Just I don’t have a PHP development environment at hand.

I have tried to attach an image to a task and it did not work either.

Sorry, I’m wrong. The upload works. The download also works. But the “view” option does not work

Ok, then as I suspected. It’s not just a plugin issue, I’ve tested this in Postgres, and it worked fine, but it was a lower version, i’ll spin up that container and see what it was.

Database version: 11.1 (Debian 11.1-1.pgdg90+1)

ya, works fine.

Same address: https://projects.nachostudio.ml

admin
admin

Sorry, I was wrong. See above. The upload and the download works. But the viewer does not work.

E.g. this does not work:

?controller=FileViewerController&action=image&task_id=51&project_id=5&file_id=2

but this DOES work:

?controller=FileViewerController&action=download&task_id=51&project_id=5&file_id=2

Yes, it works there. Then it might be something with the PostgreSQL instance?

The PostgreSQL database was created with this Dockerfile:

FROM postgres:10
RUN localedef -i hu_HU -c -f UTF-8 -A /usr/share/locale/locale.alias hu_HU.UTF-8
ENV LANG hu_HU.utf8
RUN mkdir /pg_wal
RUN mkdir /backup

The locale needs to be changed in the docker file, otherwise initdb will run with the default locale. We wanted to use correct collations for our hungarian users. I doubt that this would cause any problems, but who knows. I see nothing else that is different. :frowning:

Yes, I saw, doesn’t change anything, that’s the same issue.

Neither the plugin or Kanboard can determine the File is an image.

I saw a t in the boolean of your database, I don’t know a lot about postgres, but is there a way for that to be setup as 0 or 1, instead

I ask because, every DB I look in, it shows 1, not T
image

and my memory of the code, is looking for 1…

They are all images now:

# docker exec -ti kanboard-db psql -U postgres -d kanboard
psql (10.2 (Debian 10.2-1.pgdg90+1))
Type "help" for help.

kanboard=# select * from customizer_files;
 id | custom_id |       name       |                         path                          | is_image | size | user_id |    date
----+-----------+------------------+-------------------------------------------------------+----------+------+---------+------------
 12 |         3 | nkp_logo_100.jpg | customizer/3/2bdba66919db3dc94f9f4231e11c13c7cd4f2df7 | t        | 6523 |       2 | 1553866573
 13 |         2 | favicon.png      | customizer/2/e295b88ed734a89b4185868e7f129850671c0fac | t        | 4299 |       2 | 1553866604
 14 |         1 | 100.jpg          | customizer/1/abf4e46b66d46c14bc6a942311231d3a1755b4a9 | t        | 4365 |       2 | 1553889608
(3 rows)

This link still does not work:

https://kb.nkp.uni-eszterhazy.hu/?controller=CustomizerFileController&action=image&plugin=customizer&file_id=14

I change action to download:

https://kb.nkp.uni-eszterhazy.hu/?controller=CustomizerFileController&action=download&plugin=customizer&file_id=14

then I get “Internal Error: Action not implemented”. It differs from the task attachments.

I see. In my database, customizer_files.is_image has boolean type.

The customizer plugin’s Postgresql.sql script creates it as boolean here:

The default ‘0’ value is converted to boolean false by the PostgreSQL parser. It should better be “default false”. But that is clearly not the root of the problem.

it’s not that, my Postgres DB shows the same:

kanboard=# select * from customizer_files;
 id | custom_id |                                name                                |                         path                          | is_image | size  | user_id |    date
----+-----------+--------------------------------------------------------------------+-------------------------------------------------------+----------+-------+---------+------------
  2 |         3 | nachoteam_2018-Nov-06_03-50-42PM-000_CustomizedView16830141886.png | customizer/3/d95115e5177a762cdda82396dcf8d9b0925ca4fb | t        | 37357 |       1 | 1552081474
  3 |         2 | 26339368.png                                                       | customizer/2/1ff1015f883c0fbbe8bdaf972c9630dd9995a808 | t        |  9525 |       1 | 1552081488
  4 |         1 | 100.jpg                                                            | customizer/1/ffea93dcb82b82fdbd83597727e2962ed20ebd0e | t        |  4365 |       1 | 1553893427
(3 rows)

I think here is the problem:

I believe you should simply use:

if (!$file['is_image']) {

Needs to be tested though, I’m not 100% sure that PostgreSQL PDO driver can use the native boolean type.

I’m out of time for now, but I will test it out.

If you beat me to it, just let me know. That would have to be changed in Kanboard aswell, in the main FileController.

Ok, thank you for your help. I’m going to experiment with the PHP code.

In order for me to do anything to fix it, I would need to replicate the issue, it works fine with my instance of postgres.

I could give you an endpoint and an address if you want to try and duplicate on my server.

I don’t know how to replicate the problem. I was trying to find the problem with my database. I put this into CustomizerFileController.php:

  public function image() {
       throw new Exception("test");

but that code is not getting called. I have also tried other methods (renderFileWithoutCache and renderFileWithCache) but none of them are called. Meanwhile, there is nothing in the PHP error log. Where should I put my test code?

You’re using docker, so you will need to restart your container everytime you update code.

The render with cache method will only be called if you enabled the cache, and vice versa for without cache, however, without cache will always be used on the settings page

The image () function, I think is the header image, it should be called everytime a page loads.