1

I recently had an error becuase my kcfinder package was out of date. I fixed it by manually copying the kcfinder folder from dir/vendor/civicrm/civicrm-packages to dir/html/libraries/civicrm/packages. I had tried running composer civicrm:publish but it seems this command is not working as expected for me.

I have a slightly different structure in my project as follows:

    dir
    -html
    --libraries
    ---civicrm
    ----packages
    -vendor
    --civicrm
    ---civicrm-packages

so in my root composer.json I have:

"civicrm-asset": {
            "path": "html/libraries/civicrm",
            "url": "/libraries/civicrm"
        },

When I run composer civicrm:publish, it looks like it runs fine, I get the message:

Publishing CiviCRM assets to html/libraries/civicrm
Generating CiviCRM asset map

however, no new files seem to get written to the packages folder html/libraries/civicrm/packages. I tried changing the civicrm-asset paths in my composer.json file to:

 "civicrm-asset": {
            "path": "html/libraries/civicrm/packages",
            "url": "/libraries/civicrm/packages"
        },

Then this generates a new folder packages inside the existing html/libraries/civicrm/packages folder and has copied across the libraries. However, it doesn't copy all the files, it doesn't seem to copy some of the folders or any of the .php files.

I am recently now also getting an error on my status page:

Wrong version of assets in public web directory: expected 5.70.0 but found 5.69.4

I checked the permissions on the html/libraries/civicrm/packages folder and they seem to be fine so not sure what the problem is. I also thought it would be useful to view the generated CiviCRM asset map, but wasn't sure how to do this.

2
  • I think your original config was fine. Try the -D option to do a complete copy. But note that (a) the plugin isn't supposed to copy everything, just web assets, and (b) kcfinder is known to have problems with drupal 8+. Consider using summernote as your editor instead.
    – Demerit
    Commented Feb 19 at 18:25
  • Thanks so much @Demerit, the -D option worked, all the packages were copied over. I should have known there would have been some command options! Thanks also for the tip on summernote, although kcfinder is working ok at the moment even with Drupal 10.
    – Ben
    Commented Feb 19 at 20:03

1 Answer 1

5

Based on comments the -D option cleared out the cobwebs.

1
  • Same issue for me after a Civicrm upgrade: "Wrong version of assets in public web directory: expected 5.71.1 but found 5.70.2." Numerous attempts at composer civicrm:publish didn't work until I added the -D option. Thanks for the tip @Demerit.
    – Justin657
    Commented Mar 22 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.