cms_pico icon indicating copy to clipboard operation
cms_pico copied to clipboard

Custom Pico theme selection does not list themes after upgrade to NC26 (and hacky workaround)

Open StuartJMackintosh opened this issue 1 year ago • 21 comments

Context

  • Nextcloud 26 (upgraded from many previous versions)
  • cms_pico installed_version 1.0.21
  • database: Postgres
  • Nextcloud as docker container running inside virtual machine
  • external nginx reverse proxy
  • mixture of sites with their own domain names, and sites hosted in subfolders on the main domain
  • variety of themes

Background

Pico is listed as an untested app in NC26.

I did share this issue on IRC with @PhrozenByte who was kind enough to chat through, and plans testing of Pico & NC26 at some future point.

This issue may also relate to/duplicate #236 although I don't have enough specifics to confirm this.

The efforts with bringing Pico and themes to Nextcloud is very much appreciated!

Problem

After upgrading to NC26, the custom theme interface doesn't list installed themes, therefore these cannot be made available to users. Specifically, the 'Reload theme' button on the right has no effect, and the dropdown of themes does not list any custom themes.

Screenshot_2023-04-05_11-04-24

Looking at the code (I am not a coder), the function will read the folder listed above the box and offer these themes to be added to the installed themes. Behind the scenes, this runs basic validation of the themes, and copies them to an internal folder, for users to select.

Hacky workaround

WARNING: this is not recommended and could easily destroy all of your data

To get past my today problem, I identified the internal themes folder, manually copied the appropriate theme folders, then added the list to the config array.

As soon as this is applied, the themes are available in the personal settings dropdown

Internal themes folder

docker:~/var_www_html/apps/cms_pico/appdata_public/themes/SoWN6rCUlu$ ls
axcorapico  clean-blog  default  dimension  freelancer-pico-main  just-pico-master  picobook  piconic  story  story-custom

SQL config

update oc_appconfig set configvalue = '
{
    "story":{"name":"story","type":2,"compat":true},
    "clean-blog":{"name":"clean-blog","type":2,"compat":true},
    "dimension":{"name":"dimension","type":2,"compat":true},
    "just-pico-master":{"name":"just-pico-master","type":2,"compat":true},
    "freelancer-pico-main":{"name":"freelancer-pico-main","type":2,"compat":true},
    "picobook":{"name":"picobook","type":2,"compat":true},
    "piconic":{"name":"piconic","type":2,"compat":true},
    "story-custom":{"name":"story-custom","type":2,"compat":true},
    "axcorapico":{"name":"axcorapico","type":2,"compat":true}
}
' where appid = 'cms_pico' and configkey = 'custom_themes';

Don't forget, never run code pasted from websites, if you have not fully verified it and know exactly what it does

Hypothesis

I speculate that the issue relates to the theme copy function, theme validation or simply source file location. However having no PHP / nextcloud app dev experience, don't have the debug tools to be able to narrow this down further without lots of guesswork. If someone can tell me how to print to the log file, I may be able to add more info.

StuartJMackintosh avatar Apr 05 '23 12:04 StuartJMackintosh

I found one (the?) culprit:

the file admin.js calls $icon.tooltip(…) in Line 204. This function does not seem to be available anymore. When I commented out the lines 204-207, I got a list of themes to install.

jochenwierum avatar Apr 23 '23 11:04 jochenwierum

Thank you @jochenwierum - after removing those lines , the themes are listed (cms_pico-1.0 branch). I will report back when I have fully tested this.

From what I can understand by the commit message from @PhrozenByte, these lines were added to enable a future theming API 4 years ago (see https://github.com/nextcloud/cms_pico/commit/c82fd8d7f8b3a1642c12b3d30f02612ab4e7fe9a).

As this refers to a function that is no longer available and doesn't seem to affect functionality, will it be safe to issue a PR for the removal of those lines? Do you feel there is risk or other impact to consider?

StuartJMackintosh avatar May 01 '23 08:05 StuartJMackintosh

Issue still persisting after upgrate to NC 27.0.0

GVLLIFESTYLE avatar Jun 20 '23 10:06 GVLLIFESTYLE

I had the same issue with NC26 running in a docker container. I inadvertently managed to fix it when I set up cron.php to run to fetch NC News feeds.

harlows avatar Jun 20 '23 11:06 harlows

so what exactly did you setup in the cron.php? Does anyone know if this will be fixed some day in gerneal at the app?

GVLLIFESTYLE avatar Jun 20 '23 12:06 GVLLIFESTYLE

I simply used my local server's cron to run Docker's cron.php using: */15 * * * * docker exec -u www-data [container_name] php cron.php Then change Ajax to Cron in Settings > Basic settings. (All credit to Seismologo on Redit)

harlows avatar Jun 20 '23 19:06 harlows

Hm.. This I have already but still it does not work in my case.

Am 20. Juni 2023, 21:52, um 21:52, Stephen Harlow @.***> schrieb:

I simply used my local server's cron to run Docker's cron.php using: */15 * * * * docker exec -u www-data [container_name] php cron.php Then change Ajax to Cron in Settings > Basic settings. (All credit to Seismologo on Redit)

-- Reply to this email directly or view it on GitHub: https://github.com/nextcloud/cms_pico/issues/237#issuecomment-1599411493 You are receiving this because you commented.

Message ID: @.***>

GVLLIFESTYLE avatar Jun 21 '23 03:06 GVLLIFESTYLE

Not sure how the cron comment relates to this issue.

It is not resolved in later versions, my solution is to deploy a NC25 and create some shares between them for now.

StuartJMackintosh avatar Jun 21 '23 18:06 StuartJMackintosh

Same issue here. Cannot install themes.

  • Commenting lines 204 to 207 did not resolve the issue.
  • Copied 'themes' file to pubic folder similar to above, and this did not resolve the issue.
  • I'm wondering where the config array is... I did not update that as I don't know where the file is.

Using Nextcloud 27.0.1 (under Docker) Pico 2.1.4

rcjcarr avatar Aug 06 '23 19:08 rcjcarr

Any news on future compatibility updates. Suggested workaround didn't work. I'm currently editing themes in the public folder for now but its clearly not a sustainable way of doing things. Any other ideas ?

jkraffthha avatar Sep 15 '23 08:09 jkraffthha

Same here! Still no progress??

I tried with NC26.0.7 to no avail!

escribana avatar Sep 26 '23 08:09 escribana

Is there any chance for an update to NC 26/27? Because it was a perfect tool for our collective (yes, "collectives" app could be an alternative) . :(

Thanks a lot!

stullekovski avatar Oct 10 '23 15:10 stullekovski

I found one (the?) culprit: the file admin.js calls $icon.tooltip(…) in Line 204. This function does not seem to be available anymore. When I commented out the lines 204-207, I got a list of themes to install.

This did not help me. The tooltips in the settings (personal as well as admin) sections do not display correctly, though (grey background, but only a hint of letters is visible).

Copying the themes and plugins from the ../data/appdata_/cms_pico/ folder to the ../apps/cms_pico/appdata and ../apps/cms_pico/appdata_public/ folders also did not help (similar to @rcjcarr).

There is, however some busy indicator running before the theme selection is shown, but I did not see any errors logged in the NC logs - would some logging help to identify the problem?

NC 27.1.1 Pico for NC 1.0.21

virtualnobi avatar Oct 29 '23 19:10 virtualnobi

Fix is on the way, I've made a pull request.

jkraffthha avatar Oct 30 '23 13:10 jkraffthha

For those who might need to make it work immediatly, you can edit js/admin.js file and replace the line (205) containing .tooltip('dispose') with .tooltip('destroy').

jkraffthha avatar Nov 02 '23 14:11 jkraffthha

To my big disappointment my custom theme is still not showing in admin section of NC 27.1.5 and PICO 1.0.21! The "+" button and the "Reload Custom Theme" button do not have tips and do not react. What's wrong now? pico1-0-21

escribana avatar Dec 17 '23 13:12 escribana

For those who might need to make it work immediatly, you can edit js/admin.js file and replace the line (205) containing .tooltip('dispose') with .tooltip('destroy').

I did that, and restarted the docker images, but saw no difference.

However, at file admin.js when I commented out the lines 204-207 as described above, copy theme and list of themes worked, however, the dropdown still does not work.

Using NC 26

ahm507 avatar Feb 15 '24 05:02 ahm507

Fix is on the way, I've made a pull request.

I checked the open PRs and did not find anything related. I can create one if there is no one yet, or show us the PR link please

ahm507 avatar Feb 15 '24 07:02 ahm507

I did that, and restarted the docker images, but saw no difference.

However, at file admin.js when I commented out the lines 204-207 as described above, copy theme and list of themes worked, however, the dropdown still does not work.

Using NC 26

I have no experience with docker, however I did experience some lag (maybe cache) when I made the changes. PR has been merged and closed as far as I can see. https://github.com/nextcloud/cms_pico/pull/242

jkraffthha avatar Feb 15 '24 08:02 jkraffthha

Hi, it looks like I am very close to applying the workaround to repair themes management but I need some help.

Info : Nextcloud 29 Picocms for nextcloud 1.0.21 Apache2 +mysql

What I have done so far :

  • copying the desired themes folders to /var/www/html/cloud/apps/cms_pico/appdata_public/themes/Top8e7RZFX
  • letting them also in the indicated default folder /var/www/html/cloud/data/appdata_ocxq83qvhd3e/cms_pico/themes (I've read one comment saying it helped)

What I think could be the issues :

  • I can't find that database config file indicated in the first post and I doubt the indicated script would work with mysql (it was made for postgresql). Could someone help me to make the config changes ?
  • there is maybe a deprecated variable in the 1.0.21 code since Nextcloud updated to 29, as stated in another topic.

jin146 avatar Jul 13 '24 13:07 jin146

Nice to see progress on it ! I hope you will make it, I can't help you unfortunately

khassad avatar Jul 15 '24 23:07 khassad