Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
StuartJMackintosh opened this issue Apr 5, 2023 · 21 comments

Comments

@StuartJMackintosh
Copy link

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.

@jochenwierum
Copy link

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.

@StuartJMackintosh
Copy link
Author

StuartJMackintosh commented May 1, 2023

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 c82fd8d).

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?

@GVLLIFESTYLE
Copy link

Issue still persisting after upgrate to NC 27.0.0

@harlows
Copy link

harlows commented Jun 20, 2023

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.

@GVLLIFESTYLE
Copy link

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?

@harlows
Copy link

harlows commented Jun 20, 2023

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)

@GVLLIFESTYLE
Copy link

GVLLIFESTYLE commented Jun 21, 2023 via email

@StuartJMackintosh
Copy link
Author

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.

@rcjcarr
Copy link

rcjcarr commented Aug 6, 2023

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

@jkraffthha
Copy link
Contributor

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 ?

@escribana
Copy link

Same here! Still no progress??

I tried with NC26.0.7 to no avail!

@stullekovski
Copy link

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!

@virtualnobi
Copy link

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

@jkraffthha
Copy link
Contributor

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

@jkraffthha
Copy link
Contributor

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').

@escribana
Copy link

escribana commented Dec 17, 2023

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

@ahm507
Copy link

ahm507 commented Feb 15, 2024

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
Copy link

ahm507 commented Feb 15, 2024

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

@jkraffthha
Copy link
Contributor

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.
#242

@jin146
Copy link

jin146 commented Jul 13, 2024

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.

@khassad
Copy link

khassad commented Jul 15, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests