JoomGalleryfriends / JG4-dev

Development repository for JoomGallery v4.x
GNU General Public License v3.0
10 stars 6 forks source link

Overhaul of FileManager service #83

Closed Elfangor93 closed 1 year ago

Elfangor93 commented 1 year ago

What is this service for

The FileManager service will be used to handle the files and folders created in the filesystem. I offers methods to perform processes (create, delete, check, move) on image files and folders.

This is a overhaul of PR #26.

The usage of the FileManager is exactly the same as before but now with a complete new filesystem service. The new filesystem service support the filesystem adapter provider of com_media. Meaning that different filesystems can be used based on which filesystem plugins you have installed.

What are filesystem plugins

Filesystem plugins are a new type of plugins introduced with Joomla 4. They allow Joomla to communicate with different filesystems. In the Joomla core only one filesystem plugin is preinstalled to do operations with files on the local hosted filesystem: grafik

There are already several additional filesystem plugins available allowing you to operate with files on other, even not locally hosted filesystems like gDrive, OneCloud, Amazon S3, ...

This results that JoomGallery start to support multiple filesystems with this PR without the need of writing code by ourselfs.

How to use this service

See PR #26

How to test this service

See PR #26. Everything should work the same as before. You can even use the operations in the GUI to perform the tests.

Affected opertaions:

reni68 commented 1 year ago

Do I still have to do everything from PR #26? Including the adjustments in the HtmlView.php?

Because I only get error messages when saving an image - regardless of whether it's GD Library or ImageMagick.

Elfangor93 commented 1 year ago

You dant have to do the scriptic testing with the HtmlView.php if you dont want. Most of the operations are also available using the GUI. Please comment here if you find an issue. Please follow these instructions when reporting an issue such that I can reproduce the error and fix it. Instructions: https://github.com/JoomGalleryfriends/JG4-dev#testing

AlexanderSupp commented 1 year ago

20.03.2023 18:00 I uninstalled all components of JG4. Then I installed main, DE-Language, Save & New, Overhaul of File Manager (adaptor provider). The first tests show, that Save & New did not work. Also, I can confirm the result from @reni68 if I save an image. I repeated the above process without installing Overhaul of File Manager (adaptor provider). At this point, Save & New works. Is it necessary to activate a plugin? Screenshot 2023-03-20 220245 Screenshot 2023-03-20 220345

One image I added before installing Overhaul of File Manager (adaptor provider). To produce the screenshots above, I installed everything a second time. The second added image, which produce the error message, was not stored. Interesting is, that the first image which I added before the installation of the ... file manager ... is in the directories present. But this will not be displayed in the screenshot. It seems that the system cannot find the category's folder. But they are present.

AlexanderSupp commented 1 year ago

Yesterday I tested in my environment by DomainFactory. Today I'm checking with WampServer on PC Win 11. I uninstalled all components of JG4. Then I installed only Overhaul of File Manager (adaptor provider). The first tests show, that Save & New did not work. Now with a special Info, see screenshot below.

Screenshot 2023-03-21 110425

This Error Message detect only by Save & New. All other operations with Categories work correct.

Screenshot 2023-03-21 111132

Now the result to store an image.

Screenshot 2023-03-21 110655

Screenshot 2023-03-21 110808

Screenshot 2023-03-21 111022

reni68 commented 1 year ago

I probably can't test this PR since I don't have any non-locally hosted filesystems available. Locally stored images terminate with this error message when uploaded: Screenshot_20230320_1 Tested on Linux with XAMPP, Joomla 4.2.9 and PHP 8.0.15.

Elfangor93 commented 1 year ago

There was an error in the installation script. Your reported errors should be gone now...

You have to deinstall and install the component to make it work.

Elfangor93 commented 1 year ago

Then I installed main, DE-Language, Save & New, Overhaul of File Manager (adaptor provider). The first tests show, that Save & New did not work.

@AlexanderSupp you are messing up things. You should not install multiple branches on top of each other. It is obvious that Save & New does not work on this branch since it was fixed in another PR! With messing things up you are making my life harder. Please test one PR after another!!

Elfangor93 commented 1 year ago

I probably can't test this PR since I don't have any non-locally hosted filesystems available.

Locally hosted means in that case, that your files are stored on the same device where Joomla is running. This represents the standard case.

AlexanderSupp commented 1 year ago

Then I installed main, DE-Language, Save & New, Overhaul of File Manager (adaptor provider). The first tests show, that Save & New did not work.

@AlexanderSupp you are messing up things. You should not install multiple branches on top of each other. It is obvious that Save & New does not work on this branch since it was fixed in another PR! With messing things up you are making my life harder. Please test one PR after another!!

@Elfangor93 Sorry, I don't want to make your life harder. I forgot the specific software development strategy with GitHub in combination with Joomla. I vow to get better.

AlexanderSupp commented 1 year ago

Uninstalled JG4, installed adapter-provider. Tested with Win 11, WampServer with JG4 Default Settings. Config, Tags, Categories, Images works as expected. Fine. I would now like to test access to the Microsoft Cloud OneDrive or to my Synology NAS in the home network. Where can I read more about this?

MrMusic commented 1 year ago

Two things I have noticed: 1. I have installed two filesystem plugins: 'DPMedia FTP' and 'Amazon S3'. Both are displayed in the Joomla Media Manager. In the JoomGallery configuration, only the 'Local filesystem' still appears in the list of filesystems, not the other two. 2. Even if I use the 'Local filesystem', no more images are displayed in the image manager. Also after installing the 'Sample data' no thumbs are shown anymore although they are actually present in the file system.

MrMusic commented 1 year ago

I would now like to test access to the Microsoft Cloud OneDrive or to my Synology NAS in the home network. Where can I read more about this?

@AlexanderSupp You need a Joomla plugin to handle the access to OneDrive or the Synology NAS, but i don't know if it still exist?

Elfangor93 commented 1 year ago

In the JoomGallery configuration, only the 'Local filesystem' still appears in the list of filesystems, not the other two.

The list currently is hardcoded. A dynamic list based on your installed plugins will follow later. So if you want to test other filesystems you have to use php code accessing the filemanager service directly.

Elfangor93 commented 1 year ago

In the JoomGallery configuration, only the 'Local filesystem' still appears in the list of filesystems, not the other two.

The list currently is hardcoded. A dynamic list containing the installed plugins will follow later. So if you want to test other filesystems you have to use php code accessing the filemanager service directly.

Even if I use the 'Local filesystem', no more images are displayed in the image manager.

I also had this effect on some testing systems. But I was not able to localize any error. I have the feeling that the stream_get_contents() php function does not work properly on every system...

reni68 commented 1 year ago

My test today with local filesystem:

Tested on Linux with XAMPP, Joomla 4.2.9 and PHP 8.0.15.

Elfangor93 commented 1 year ago

But images are not visible in the JoomGallery:

Can you post the answer of the requests fetching the thumbnails? You can do that using the network tab in your browser console...

reni68 commented 1 year ago

Can you post the answer of the requests fetching the thumbnails? this? Screenshot_20230322_1 Screenshot_20230322_2

Or how do I get that exported?

reni68 commented 1 year ago

This of vivaldi: vivaldi

Elfangor93 commented 1 year ago

Oke I think I found the issue why images were not displayed in some environments. Can you please try again? Are they now showing up in your testing systems?

reni68 commented 1 year ago

Yes, now the images and thumbnails are visible :-) Great! Screenshot_20230324_1 Screenshot_20230324_2

eumel1602 commented 1 year ago

When I'm in the picture manager, you can display the filter options. It strikes me that the category sorting "Label" is too big. Even the "white finger" goes away when you move the mouse over it. This is also the case with "Choose access level". The function is ok but is a display error... The two buttons "Status" (on the left) and "User" (on the right) are ok See image jg-1

eumel1602 commented 1 year ago

I haven't been able to find any errors so far: I was able to test the following functions: create Images, delete Images, move Images, copy Images, create Category, delete Category, move Category, copy Category

I'm testing with J4.2.9 / PHP 8.0.20 / Win 10

MrMusic commented 1 year ago

Yes, now the images and thumbnails are visible :-)

Confirmed.

I was able to test the following functions: create Images, delete Images, move Images, copy Images, create Category, delete Category, move Category, copy Category

@eumel1602: Did you test uploading new images after moving categories?

For me the problem of issue https://github.com/JoomGalleryfriends/JG4-dev/issues/44 still exists.

reni68 commented 1 year ago

For me the problem of issue #44 still exists.

Yes, with me too and the "old" picture, which was moved with, is also no longer visible.

Elfangor93 commented 1 year ago

All the other upload related bugs from the issue tracker are solved? Then I guess the corresponding issues can be closed.

eumel1602 commented 1 year ago

@eumel1602: Did you test uploading new images after moving categories?

For me the problem of issue #44 still exists.

Hello. I cannot confirm this error. this works for me with no problems. I tested it again now...

eumel1602 commented 1 year ago

updated: !!! I can upload new images but old images that were moved are missing

Elfangor93 commented 1 year ago

Issue #44 will be solved within PR #86.