concretecms / brand_central

A digital asset management system extension for Concrete CMS.
13 stars 4 forks source link

Ramsey\Uuid\Uuid #106

Closed katalysis closed 6 months ago

katalysis commented 7 months ago

I have everything working well on 9.2.6 except for downloading a file which generates and error:

Exception Occurred: /var/www/vhosts/dev43.katalysis.net/httpdocs/packages/brand_central/controllers/single_page/collections/download.php:250 Class "Ramsey\Uuid\Uuid" not found (0)

Ramsey is missing from the initial install. I tried requiring it with composer which seems to work in principle but I still get the error

aembler commented 7 months ago

Could you let me know how you're installing the package? Did you check it out from git, copy it into the packages/ folder and install it (traditional Concrete install) or did you install this package via composer (something like composer require concrete5/brand_central in a project directory.)

katalysis commented 7 months ago

I've downloaded the repository and then tried to build using composer. The composer file in the repository root doesn't work for me (see below) so I hacked about the older example found here:

https://github.com/concretecms/brand_central/blob/master/INSTALL.md

This results in a more or less working install but with the download functions broken and no Ramsey\Uuid etc.

If I use the composer file from the root I get these issues:

` Problem 1

aembler commented 7 months ago

Ah, I see what the problem is. We actually have a parent project, which installs Concrete, Brand Central, a couple of custom dependencies we use for the project itself, and the Drop Box add-on https://github.com/concretecms/drop_box.

It's this drop box add-on that actually installs the Ramsey\UUID package, which is why we weren't seeing this error. However, Brand Central should be installable in this standalone way, so I'm going to try and ship a fix for this.

First, if you check out this pull request - could you see if this update fixes your issue? It should ship the proper package in Brand Central to remediate the specific error.

https://github.com/concretecms/brand_central/pull/107

Next, you might consider also installing the Drop Box add-on linked above - it has some functionality that is useful within BrandCentral.

katalysis commented 7 months ago

So have checked out pull request, run composer install (including adding mlocati/composer-patcher). This builds properly, however, if I replace the previously almost working brand_central package with this on my 9.2.6 install I get various errors:

First on the home page:

preg_match(): Compilation failed: invalid range in character class at offset 4

If I navigate to other pages e.g. /collections:

Whoops \ Exception \ ErrorException (E_COMPILE_ERROR) Cannot declare class Concrete\Core\Entity\Board\Designer\CustomElement, because the name is already in use

screencapture-dev44-katalysis-net-index-php-2024-02-21-17_58_53 screencapture-dev44-katalysis-net-login-2024-02-21-18_09_17

aembler commented 7 months ago

Hmm, typically that error means that the patches were not actually installed.

katalysis commented 7 months ago

It looks to me as if they did install but composer is not my strong suit...

"config": { "allow-plugins": { "pestphp/pest-plugin": true, "mlocati/composer-patcher": true } }

Not really sure where to go from here to get a working installation?

KorvinSzanto commented 7 months ago

@katalysis I'm not sure about your declare error but you can fix the other one by requiring https://packagist.org/packages/concretecms/dependency-patches.

In reality this package isn't really well supported outside of a composer based installation.

katalysis commented 7 months ago

Tried @aembler's fix above on top of a composer based install of Concrete CMS but then get a mime type error:

Exception Occurred: /var/www/vhosts/dev44.katalysis.net/httpdocs/concrete/vendor/symfony/http-foundation/File/File.php:78 You cannot guess the mime type as the Mime component is not installed. Try running "composer require symfony/mime". (0)

Adding symfony/mime then takes us back to the Ramsey/Uuid error:

Exception Occurred: /var/www/vhosts/dev44.katalysis.net/httpdocs/packages/brand_central/controllers/single_page/assets/download.php:287 Class "Ramsey\Uuid\Uuid" not found (0)

So I've then tried to use drop_box too as suggested by Andrew, after running the build routine for this and uploading to packages etc. I get a new error:

Call to undefined method Concrete\Core\Application\Application::share()

We probably need to draw a line under this now without a clear route to a fully working installation.

aembler commented 6 months ago

Let's try a different approach. I'm concerned that there are deeper systemic problems with installing BrandCentral in a non-composer based Concrete install. We've never personally used non-composer BrandCentral in production; I thought that some simple fixes to the package might get us where we need to go but I think there may be deeper problems.

With that in mind, can we try switching to an install that installs Concrete, BrandCentral and the Drop Box add-on via Composer instead of using standalone Concrete packages? It should be fairly simple. I've set up a new repository with a composer.json that should bring all the required dependencies. It has a pretty comprehensive README, which I've used to verify that this project can install locally.

https://github.com/concretecms/brand_central_client

Can you switch to using that with the instructions that are in the README file, and let me know if that makes installation work better for you @katalysis ?

katalysis commented 6 months ago

@aembler thank you, that's working nicely.

aembler commented 6 months ago

Awesome, glad to hear it!