CiviCRM Asset Plugin issueshttps://lab.civicrm.org/dev/civicrm-asset-plugin/-/issues2021-11-09T12:08:26Zhttps://lab.civicrm.org/dev/civicrm-asset-plugin/-/issues/19Issues with the extension name vs key while building2021-11-09T12:08:26ZVangelisPIssues with the extension name vs key while buildingI've found an issue that relates with the way this component is reading the information from the extension and creates the relevant folder.
One example is `stripe` (but many more are having the same issue). Here is how we include it int...I've found an issue that relates with the way this component is reading the information from the extension and creates the relevant folder.
One example is `stripe` (but many more are having the same issue). Here is how we include it into composer:
```json
{
"name": "civicrm/extensions",
"description": "CiviCRM extensions",
"type": "civicrm-extension",
"require": {
"civicrm/stripe": "6.6.3"
},
"repositories": [
{
"type": "vcs",
"url": "https://lab.civicrm.org/extensions/stripe.git"
}
]
}
```
Now, due to [this line](https://lab.civicrm.org/dev/civicrm-asset-plugin/-/blob/master/src/ExtensionAssetRule.php#L17) , what is actually being created under the folder `web/libraries/civicrm` is `com.drastikbydesign.stripe` which is the `key` of the extension and not the project name (shortname).
In the meantime, stripe is being downloaded under the vendor folder as `stripe` and not as `com.drastikbydesign.stripe`.
If stripe is including some JS/CSS, those will NOT be read in CiviCRM as Civi is searching for the folder `web/libraries/civicrm/stripe` and not `web/libraries/civicrm/com.drastikbydesign.stripe`.
I can think of 2 possible solutions here:
1. instead of the attribute `key`, use (?) the `<file>` tag?
2. keep reading the attribute `key` as-is but also pass the actual folder name (which should be under the attribute `file`)
Any thoughts?https://lab.civicrm.org/dev/civicrm-asset-plugin/-/issues/14Command "composer civicrm: publish" is not executed automatically?2021-12-03T14:43:54ZwouterhCommand "composer civicrm: publish" is not executed automatically?I was upgrading our drupal 8 and CiviCRM installation, as our vendor directory is outside the webroot, as a solution we ran a bash script via composer.json scripts to put all assets in the right place in the webroot.
I recently saw that...I was upgrading our drupal 8 and CiviCRM installation, as our vendor directory is outside the webroot, as a solution we ran a bash script via composer.json scripts to put all assets in the right place in the webroot.
I recently saw that "civicrm-asset-plugin" is available, while implementing this I saw that the command `composer civicrm: publish` was not executed, so I have to run this manually after a composer install/update.
I solved this by adding this in our composer.json:
```
"scripts": {
"post-install-cmd": [
"@composer civicrm:publish"
],
"post-update-cmd": [
"@composer civicrm:publish"
]
}https://lab.civicrm.org/dev/civicrm-asset-plugin/-/issues/12doesn't work with Varbase distribution2021-02-25T19:31:44Zahilliodoesn't work with Varbase distributionNot sure why but CiviCRM installation on Varbase doesn't work the way it's supposed to, it requires some manual interventions:
```
composer create-project Vardot/varbase-project varbase2 --no-dev --no-interaction
composer require civicr...Not sure why but CiviCRM installation on Varbase doesn't work the way it's supposed to, it requires some manual interventions:
```
composer create-project Vardot/varbase-project varbase2 --no-dev --no-interaction
composer require civicrm/civicrm-asset-plugin:'~1.1'
composer require civicrm/civicrm-{core,packages,drupal-8}:'~5.31'
```
After installing the asset plugin, the require civi-core fails in a couple ways:
1) `Applying patches for adrienrn/php-mimetyper
https://patch-diff.githubusercontent.com/raw/adrienrn/php-mimetyper/pull/15.patch (Update gitignore to ensure that sites that manage via git don't miss out on the important db.json file)` has to be done manually, all that patch does is gitignore node_modules, anyway, it fails to apply and stops composer. So, go apply that patch yourselve and then require civicrm-core again...
2) It will run for a long time, and then fail with some messages, saying "reverting composer.json to its original content" but that doesn't actually happen, composer.json doesn't actually get reverted and all the files downloaded are in place.
3) `docroot/libraries/civicrm` is missing, so I copy it from a non-broken installation, and then git commit. And at this point CiviCRM seems to work, but this plugin didn't seem to do what's I believe it's supposed to.
Originally noted at https://www.drupal.org/project/varbase/issues/3181336https://lab.civicrm.org/dev/civicrm-asset-plugin/-/issues/5civicrm-core/extern/widget.php not being copied over2021-03-11T17:29:21Zmark-rodgers11markrodgers11@gmail.comcivicrm-core/extern/widget.php not being copied over- OS: CentOS Linux release 7.8.2003 (Core)
- Apache: 2.4.6
- MariaDB: 5.5.65
- PHP: 7.2.30
- CiviCRM: 5.26.1
- Drupal: 8.8.5
Project was created using `roundearth/drupal-civicrm-project`
---
`vendor/civicrm/civicrm-core/extern` does n...- OS: CentOS Linux release 7.8.2003 (Core)
- Apache: 2.4.6
- MariaDB: 5.5.65
- PHP: 7.2.30
- CiviCRM: 5.26.1
- Drupal: 8.8.5
Project was created using `roundearth/drupal-civicrm-project`
---
`vendor/civicrm/civicrm-core/extern` does not get copied to `web/libraries/civicrm/core`
![image](/uploads/104d7635b1c7fe59ff44c0b838f2a7c2/image.png)
```
"extra": {
"civicrm-asset": {
"assets:core": {
"include": ["js/**", "css/**", "ang/**", "templates/**.png", "templates/**.jpg", "extern/**"]
}
}
}
```
I've added this to my composer.json which did copy over everything in extern to libraries/civicrm/core/extern, namely widget.php. Now I'm just getting a _*404 (Forbidden)*_ error when trying to access https://example.com/libraries/civicrm/core/extern/widget.php, not sure why though since widget.php has `-rw-rw-r--` and is owned by the correct user & group.
Although.. I have a feeling even if I got this widget.php to be publically web accessible, it wouldn't work as it has a few requires with relative paths..
```
require_once '../civicrm.config.php';
require_once 'CRM/Core/Config.php';
require_once 'CRM/Utils/Request.php';
require_once 'CRM/Contribute/BAO/Widget.php';
```5.32.0https://lab.civicrm.org/dev/civicrm-asset-plugin/-/issues/4kcfinder libraries is missing files2023-07-05T05:41:48Zkarunadevkcfinder libraries is missing filesI notice there are far more files and directories for kcfinder ./vendor/civicrm/civicrm-packages/kcfinder/ compared to ./web/libraries/civicrm/packages/kcfinder. For example the browse.php file is not present in libraries path, which exp...I notice there are far more files and directories for kcfinder ./vendor/civicrm/civicrm-packages/kcfinder/ compared to ./web/libraries/civicrm/packages/kcfinder. For example the browse.php file is not present in libraries path, which explains why the functionality to find and upload images in CiviMail or CiviEvent does not work and produces a 'page not found' error in the logs
`/libraries/civicrm/packages/kcfinder/browse.php?cms=civicrm&type=images&CKEditor=crmUiId_1&CKEditorFuncNum=0&langCode=en-ca. `
Copying the kcfinder contents from /vendor path to the /libraries path does not help, so there is more to this.
BTW, test case summary is:
#installed with
`
composer create-project drupal/recommended-project <path>
composer require civicrm/civicrm-asset-plugin civicrm/civicrm-drupal-8 civicrm/civicrm-packages
`
Also occurs with
`
composer create-project roundearth/drupal-civicrm-project:8.x-dev www-cmnty-drupal --no-interaction
`
#set permissions (Cpanel machine) run with root
`
cd ./web
chown -R user:nobody .
find . -type d -exec chmod u=rwx,g=rx,o= '{}' \;
find . -type f -exec chmod u=rw,g=r,o= '{}' \;
cd /sites
find . -type d -name files -exec chmod ug=rwx,o= '{}' \;
for d in ./*/files
do
find $d -type d -exec chmod ug=rwx,o= '{}' \;
find $d -type f -exec chmod ug=rw,o= '{}' \;
done
`
#enable
`chmod +w web/sites/default
vendor/drush/drush/drush pm-enable -y civicrm`