[Beta] [Needs Testing] Pico CMS for Nextcloud v1.0.0

This is expected behavior, the navigation shows pages on the first navigation level only. How these pages are supposed to be shown (e.g. as a blog) depends on the theme you use. You can install custom themes using the app’s admin interface. You’ll find a selection of officially promoted 3rd-party themes on http://picocms.org/themes/ and a even bigger list of more 3rd-party themes on https://github.com/picocms/Pico/wiki/Pico-Themes

1 Like

Good things need time: The second beta of Pico CMS for Nextcloud is out now! :partying_face: :confetti_ball: :tada:

Pico CMS for Nextcloud v1.0.0-beta.2 utilizes Pico v2.1.0-beta.1 (bringing Pico 2.1 in beta was the reason why this took longer than expected initially).

Again we’re looking for testers, feedback is highly appreciated :heavy_heart_exclamation: I’m assuming Pico CMS for Nextcloud to be stable and ready for production, the second beta is just a way to make things bullet-proof. Pico CMS for Nextcloud v1.0.0 will be released on 24th November 2019 (unless bad things happen in the next two weeks, but I doubt that).

If you’re a developer, we’re also looking forward to your code review - you can find all changes in nextcloud/cms_pico#77 :+1:

If you find any issues or want to give feedback, you can either open a new Issue on GitHub , reply to nextcloud/cms_pico#77 or simply reply to this thread. If you wanna do a code review, please use GitHub’s review feature from within nextcloud/cms_pico#77.

We’re looking forward to your feedback and reviews! Thank you! :heart:


Download

You can download Pico CMS for Nextcloud’s release archive from here:

:arrow_right: cms_pico-1.0.0-beta.2.tar.gz (Click here to download!) :arrow_left:

Heads up! If you’re currently running Pico CMS for Nextcloud v1.0.0-beta.1 you MUST check the “I’m running v1.0.0-beta.1 right now” section below before upgrading. This is also true when upgrading to v1.0.0 later - you’ll break your installation otherwise!


Installation and Upgrading

Just refer to the “Installation and Upgrading” section above for install instructions, you just have to use the tarball of the second beta instead :ok_hand:

However, if you’re currently running v1.0.0-beta.1, you MUST check the section below first!


I’m running v1.0.0-beta.1 right now

There’s an issue with the first beta that will make the upgrade fail - no matter to which version you upgrade (i.e. doesn’t matter whether v1.0.0-beta.2 or v1.0.0). Even worse, if you’re currently running v1.0.0-beta.1, a later stable release of Pico CMS for Nextcloud won’t show up in your Nextcloud.

All this happens because v1.0.0-beta.1 is falsely identifying itself as v1.0.0. This is impossible to fix without upgrading to an intermediate version - like v1.0.0-beta.2. For this reason :exclamation: you MUST upgrade to v1.0.0-beta.2 first :exclamation: Naturally we added a security measure to the build script to prevent stupid errors like this in the future… :unamused:

Okay, now you know what’s going on, head over to the upgrade instructions.

2 Likes

Hm - probably my fault, but replacing the apps/pico_cms with beta2 triggers a web-based update which in turn delivers:
Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing 'UPDATE "oc_cms_pico_websites" w SET "w"."theme" = ?, "w"."type" = ?, "w"."options" = ? WHERE "w"."id" = ?' with params ["default", 1, "[]", 2]: SQLSTATE[42703]: Undefined column: 7 FEHLER: Spalte »w« von Relation »oc_cms_pico_websites« existiert nicht LINE 1: UPDATE "oc_cms_pico_websites" w SET "w"."theme" = $1, "w"."t... ^

I originally had Nextcloud 16, did upgrade to 17 (although it did complain about CMS Pico not being supported). CMS Pico did work fine afterwards. I was reading about the necessity to first upgrade to beta2 - so I was doing it… wget, tar, mv, chmod, chown

Any suggestion?

Fully detail (let me know if you need translation)
Update vorbereiten

Log-Level auf "debug" gesetzt

Wartungsmodus eingeschaltet

Reparaturschritt: Repair MySQL collation

Reparaturinformation: Not a mysql database -> nothing to do

Reparaturschritt: Repair SQLite autoincrement

Reparaturschritt: Copy data from accounts table when migrating from ownCloud

Reparaturschritt: Drop account terms table when migrating from ownCloud

Das Datenbankschema wird aktualisiert

Datenbank aktualisiert

Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing 'UPDATE "oc_cms_pico_websites" w SET "w"."theme" = ?, "w"."type" = ?, "w"."options" = ? WHERE "w"."id" = ?' with params ["default", 1, "[]", 2]: SQLSTATE[42703]: Undefined column: 7 FEHLER: Spalte »w« von Relation »oc_cms_pico_websites« existiert nicht LINE 1: UPDATE "oc_cms_pico_websites" w SET "w"."theme" = $1, "w"."t... ^

Hmmm - apparently something is going wrong here. The Postgresql Documentention (https://www.postgresql.org/docs/current/sql-update.html) says:
The name of a column in the table named by *'table_name'* . The column name can be qualified with a subfield name or array subscript, if needed. Do not include the table's name in the specification of a target column — for example, 'UPDATE table_name SET table_name.col = 1' is invalid.

I did change lib/Migration/Version010000From000908.php - removing the “w.”'s to:

    private function migratePrivateWebsites(array $themesMigrationMap)
        {
                $qbUpdate = $this->databaseConnection->getQueryBuilder();
                $qbUpdate
                    ->update(CoreRequestBuilder::TABLE_WEBSITES)
                    ->set('theme', $qbUpdate->createParameter('theme'))
                    ->set('type', $qbUpdate->createParameter('type'))
                    ->set('options', $qbUpdate->createParameter('options'))
                    ->where($qbUpdate->expr()->eq('id', $qbUpdate->createParameter('id')));

            $selectCursor = $this->databaseConnection->getQueryBuilder()
                    ->select('id', 'site', 'theme', 'type', 'options')
                    ->from(CoreRequestBuilder::TABLE_WEBSITES)
                    ->execute();

Now migration went through…

This is rather weird… No idea why PostgreSQL has an issue with this, it definitely supports table aliases. Furthermore Doctrine should take care of this, but doesn’t for some reason. Anyway, since we don’t need those aliases, I simply removed them, just like you did in the provided snippet. Thanks for your report!

Version 1.0 in the app store! Awesome!

A post was split to a new topic: Pico CMS for Nextcloud 1.0.0

Pico CMS for Nextcloud v1.0.0 is out now! :partying_face: :confetti_ball: :tada:

:arrow_right: You can find the full announcement here: Pico CMS for Nextcloud v1.0.0 is out now! :arrow_left:


Announcement for beta testers

First I want to give a big :clap: :clap: :clap: to all beta testers!

Thank you guys for testing and helping to improve Pico CMS for Nextcloud. We finally made it, we got a stable release! :heart:

As you know Pico CMS for Nextcloud v1.0.0 is mostly a rewrite from scratch. If you’re a developer and want to check out the code changes, simply compare v0.9.8 with v1.0.0 - it’s a massive changeset, the pull request itself consists of 238 commits with 14,801 added, 5,669 removed and 20,470 lines of code in 179 files. This is huge! :heart_eyes: Just check out the original announcement for the first beta for more details.

Even though the stable version is finally there, we’re still looking forward to your feedback and reviews! Thank you! :+1:


Download

You can download Pico CMS for Nextcloud’s release archive from here:

:arrow_right: cms_pico-1.0.0.tar.gz (Click here to download!) :arrow_left:

Heads up! If you’re currently running Pico CMS for Nextcloud v1.0.0-beta.1 you MUST upgrade to v1.0.0-beta.2 first before upgrading to v1.0.0 - you’ll break your installation otherwise!. Please refer to the announcement of v1.0.0-beta.2 for more details.


Installation and Upgrading

Just refer to the “Installation and Upgrading” section above for install instructions, you just have to use the tarball of the final release instead :ok_hand:

However, if you’re currently running v1.0.0-beta.1, you MUST upgrade to v1.0.0-beta.2 first. Also see the announcement of v1.0.0-beta.2.


@rakekniven: This was actually the announcement for beta testers only, I was about to write a “real” announcement today :smile: But thank you anyway! I simply edited my post in the split up news thread :+1:

I have probably a newbie question about theming in the Nextcloud Pico CMS app: If I want to install e.g. the https://github.com/BesrourMS/story theme, on github it requires some config.php changes:

$config[‘theme’] = ‘story’;
$config[‘pages_order_by’] = ‘date’;
$config[‘pages_order’] = ‘desc’;
$config[‘PicoExcerpt.enabled’] = true;
$config[‘excerpt_length’] = 12;

In which file do I have to add these entries and also where in the file?

Welcome to Nextcloud Help @held! :slightly_smiling_face:

There’s no per-website config file yet (but there’s an feature request for it, see https://github.com/nextcloud/cms_pico/issues/30), but a global one that works on a global basis (i.e. for all websites). This might not be what you actually want.

You can find said global config file at data/appdata_*/cms_pico/config - simply create a empty config.yml in this directory. You can use config.yml.template as a basis. In Pico CMS for Nextcloud you don’t have to change the theme config; simply add the story theme as custom theme using the app’s admin interface and choose your websites to use this theme. Also add the custom PicoExcerpt plugin using the app’s admin interface. Then add the following to your global config.yml:

pages_order_by: date
pages_order: desc
PicoExcerpt.enabled: true
excerpt_length: 12

Hey, thanks for your answer! I Think that should be added to the official app docu, right? For me it wasn’t that obvious. Global config is currently ok for me, but per website would be even better.

To stay at that specific theme, some new questions pop up:

1st two plugins are needed (PicoExcerpt and PicoParsePagesContent) and both tell me This plugin exists for historic reasons only and should not be used!. What’s up there?

2nd URL image loading does not work. E.g. story does provide a sample page that refers to images which are stored on another server and which are brought to the index.md etc just by writing the image URL. Is that a theme problem, a pico-cms nextcloud app problem or a webserver problem?

1st two plugins are needed (PicoExcerpt and PicoParsePagesContent) and both tell me This plugin exists for historic reasons only and should not be used! . What’s up there?

Exactly what is written there: They should no longer be used since they exist for historic reasons only. You could simply remove the use of excerpts in the theme and use the alternative as shown in the README.md of PicoExcerpt. Please keep in mind that this is a 3rd party theme, thus we can’t really provide any support for it. But you can still ask the theme developer whether he updates his theme.

2nd URL image loading does not work. E.g. story does provide a sample page that refers to images which are stored on another server and which are brought to the index.md etc just by writing the image URL. Is that a theme problem, a pico-cms nextcloud app problem or a webserver problem?

That’s not possible with Pico CMS for Nextcloud due to security reasons. You must host all images locally.

Thanks a lot for this work.

I “think” I upgraded to the beta1 and should then go first to beta2, but I do not know what I did.

Is there some way to find out which is the current version other than from the NC user interface? Any specific filenumber or something in the installation that can show me?

May I just remove the present version including all files from from the app-folder and then reinstall the latest version as an alternative ?

You can check the app’s appinfo/info.xml. If it shows <version>1.0.0</version>, it might actually be v1.0.0-beta.1 due to the issue mentioned a few posts before. You can validate that by checking whether the file lib/Migration/Version010000From000908.php exists. If it exists, it’s indeed v1.0.0, otherwise it’s v1.0.0-beta.1.

If you want to wipe cms_pico from your Nextcloud without using Nextcloud’s UI, remove the directories apps/cms_pico/ as well as data/appdata_*/cms_pico/ and clean up your database by executing the following SQL queries:

DELETE FROM oc_appconfig WHERE appid = 'cms_pico';
DELETE FROM oc_migrations WHERE app = 'cms_pico';
DROP TABLE oc_cms_pico_websites;

Thank you. I have only four php files in /var/www/Pico/lib/
AbstractPicoPlugin.php, Pico.php, PicoPluginInterface.php and PicoTwigExtension.php
No Migration folder. So this is version1.0.0-beta 1.

From your answer I wonder if it will be enough just to inactiavte and remove the current PicoCMS using Nextcloud’s UI. I can easily also delete the Pico-folder but the SQL stuff is a bit more complicated. Do I need to execute the SQL queries? Or what is the easiest way to proceed from my situation?

Thank you. I have only four php files in /var/www/Pico/lib/
AbstractPicoPlugin.php, Pico.php, PicoPluginInterface.php and PicoTwigExtension.php

That’s not Pico CMS for Nextcloud at all, that’s just plain Pico.

OK. I have an old installation also, apparently located in /var/www/Pico/lib/. Should I remove those folders?

I also found this /var/www/nextcloud/apps/cms_pico/lib/Migration/Version010000.php
So it seems I have the true v 1.0.0! Very nice. So I have the latest version, and can proceed and install the v1.0.1 when it comes.

When upgrading the app to 1.0.1 from the userinterface I got an error and the NC stopped in maintenance mode.

I did /var/www/nextcloud$ sudo -u www-data php occ maintenance:repair

Among the lines I got this:

  • Preparing app data of Pico CMS for Nextcloud
    • Checking Pico CMS requirements …
    • Syncing Pico CMS app data folder …
    • Copying Pico CMS config …
    • WARNING: Replacing Pico CMS config file “config.yml.template”
    • Registering Pico CMS templates …
    • Adding Pico CMS system template “empty”
    • Adding Pico CMS system template “sample_pico”
    • Keeping Pico CMS custom template “empty-v0.9”
    • Keeping Pico CMS custom template “sample_pico-v0.9”
    • Publishing Pico CMS themes …
    • WARNING: Replacing Pico CMS system theme “default”
    • Publishing Pico CMS plugins …
    • Adding Pico CMS system plugin “PicoDeprecated”

Did
/var/www/nextcloud$ sudo -u www-data php occ app:disable cms_pico

After that I could access NC.
Found cms_pic version 1.0.1 as inactive app in the list of apps. Activated and now it seems OK.

I guess something is wrong - maybe because of the old install?

I did that
Deaktivated and removed Pico CMS app from NC user interface
Removed the old installation found at /var/www/Pico via the terminal
entered the database sudo mysql -h localhost -u myusername -p mydatabasename

and did
DELETE FROM oc_appconfig WHERE appid = ‘cms_pico’;
DELETE FROM oc_migrations WHERE app = ‘cms_pico’;
DROP TABLE oc_cms_pico_websites;

Then reinstalled Pico CMS via the NC user interface from apps/social

Worked very well. Have now Pico CMS 1.0.1

Can’t see any issue, aside from that NC shouldn’t remain in maintenance mode. The warnings will be shown on every update of Pico CMS for Nextcloud, they just inform you that system themes/plugins/themes are managed by the app and due to this might change behavior with any update.