ImageCRUD updates?

Hi Johnny,

Any chance we’d ever see an update of Image CRUD ?
I’ve used it with CI3 with a bunch of success, and looked to see how to integrate it with CI4. I tried updating the Image Crud and Image Moo library files, and while they didn’t throw any php errors, they didn’t work upon implementation…got a “No direct script access allowed” message when trying to edit a set of photos…so clearly I missed something along the way. :frowning_face:

I could go an entirely different direction, of course.
Ultimately, what I like about it is the ability to upload a bunch of photos against a given record, and be able to drag/drop to reorder the sequence of them…and be able to delete them…it’s a great little interface for exactly what I needed.

So…just thought I’d see if there was any chance of it being updated or not.

Thanks much,

Erick

fyi - i think i have this working in CI4, so feel free to ignore this one…thx

Hello @ekrueger ,

I am glad that you have it working for CI 4. I have revisited a little bit and it seems that the image_moo library was not up to date. So I have updated the version for CI3 here: image-crud/application/libraries/image_moo.php at master · scoumbourdis/image-crud · GitHub

Now for Codeigniter 4, I can update image CRUD so it will also have support for PHP 8 as well.

Having a proof of concept that this is also working for you is great :slight_smile: . I’ve also checked the code and it won’t take much for the update.

@ekrueger one question for you :slight_smile: . I was thinking to have the new version as a composer package. Since you are an old Codeigniter user, coming from version 2 to now Codeigniter 4, how would you feel having a Codeigniter library as a composer library? I believe that this is the way moving forward to be honest but I wanted to get a community feedback as well.

Regards
Johnny

Hey Johnny,
Yeah, it definitely wasn’t a substantial effort to update…my biggest miss was needing to go update the view, and once I did that, it basically just worked.

I have no issue with it being in composer…kind of makes sense really.

Thanks,
Erick

Hello @ekrueger and whoever else is interested. I now have image CRUD as a composer package for Codeigniter 4 . You can install it with 3 simple steps:

composer require grocerycrud/image-crud
cp vendor/grocerycrud/image-crud/src/ImageCrud/ImageCrudPublisher.php app/Publishers
php spark publish

Official documentation will soon follow. Just keep in mind that I have changed the functions instead of lower case underscore to be camel case instead. For example:

        $imageCrud = new ImageCrud();

        $imageCrud->setPrimaryKeyField('id');
        $imageCrud->setUrlField('url');
        $imageCrud->set_title_field('title');
        $imageCrud->setTable('example_4')
            ->setOrderingField('priority')
            ->setImagePath('uploads');

        $output = $imageCrud->render();