nextcloud / cms_pico

🗃 Integrate Pico CMS and let your users manage their own websites
https://apps.nextcloud.com/apps/cms_pico
GNU Affero General Public License v3.0
134 stars 42 forks source link

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

Open StuartJMackintosh opened 1 year ago

StuartJMackintosh commented 1 year ago

Context

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 commented 1 year ago

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 commented 1 year ago

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?

GVLLIFESTYLE commented 1 year ago

Issue still persisting after upgrate to NC 27.0.0

harlows commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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: @.***>

StuartJMackintosh commented 1 year ago

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 commented 1 year ago

Same issue here. Cannot install themes.

Using Nextcloud 27.0.1 (under Docker) Pico 2.1.4

jkraffthha commented 1 year ago

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 commented 1 year ago

Same here! Still no progress??

I tried with NC26.0.7 to no avail!

stullekovski commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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

jkraffthha commented 11 months ago

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 commented 9 months ago

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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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

jin146 commented 2 months ago

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 :

What I think could be the issues :

khassad commented 2 months ago

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