e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
318 stars 212 forks source link

[Bug]: Can not create new pages on v2.3.3 #5164

Open brwnie opened 6 months ago

brwnie commented 6 months ago

What e107 version are you using?

v2.3.3

Bug description

Have just upgraded to v2.3.3 from v2.3.2 via copy/paste of new files onto old.

I've found this version unusual that there was no database upgrade option after copying files.

Upon creating a new page, I get SQL Insert Error:

image

Extract from developer mode gives more specific SQL error details:

SQL Error #42S22: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'page_metatitle' in 'field list' SQL QRY Error

`Array ( [_FIELD_TYPES] => Array ( [page_id] => int [page_title] => str [page_subtitle] => str [page_chapter] => str [page_template] => str [page_author] => int [page_text] => str [page_datestamp] => int [page_class] => str [page_rating_flag] => int [page_comment_flag] => int [page_password] => str [page_sef] => str [page_metatitle] => str [page_metadscr] => str [page_metakeys] => str [page_metaimage] => str [page_metarobots] => safestr [page_order] => str [page_fields] => json [menu_name] => str [menu_title] => str [menu_text] => str [menu_template] => str [menu_class] => int [menu_button_text] => str [menu_button_url] => str [menu_icon] => str [menu_image] => str )

[data] => Array
    (
        [page_id] => 
        [page_title] => testing
        [page_subtitle] => 
        [page_chapter] => 0
        [page_template] => default
        [page_author] => 1
        [page_text] => [html]<p>some text</p>[/html]
        [page_datestamp] => 1703945009
        [page_class] => 0
        [page_rating_flag] => 0
        [page_comment_flag] => 0
        [page_password] => 
        [page_sef] => testing
        [page_metatitle] => 
        [page_metadscr] => 
        [page_metakeys] => 
        [page_metaimage] => 
        [page_metarobots] => 
        [page_order] => 10087
        [page_fields] => 
        [menu_name] => 
        [menu_title] => 
        [menu_text] => 
        [menu_template] => default
        [menu_class] => 0
        [menu_button_text] => 
        [menu_button_url] => 
        [menu_icon] => 
        [menu_image] => 
    )

)`

e107 Version 2.3.3

Site Theme bootstrap5

Admin Theme Bootstrap 3 v1.0 by e107 Inc (2013-12-25)

Install date Monday 18 October 2010 - 00:08

Server Apache/2.4.41 (Ubuntu)

PHP Version 7.4.3-4ubuntu2.19

MySQL 8.0.35-0ubuntu0.20.04.1 PDO: Enabled Mode: NO_ENGINE_SUBSTITUTION

Charset utf-8

Server Time Saturday 30 December 2023 - 14:05

How to reproduce

Create a new page, insert text, click save

Expected behavior

Successfully create new page

What browser(s) are you seeing the problem on?

Firefox

PHP Version

7.4.3

Vodhin commented 6 months ago

I can confirm that I, too, cannot create a new Page or menu. Same results as OP (I am using PHP 7.4.33)

brwnie commented 6 months ago

I've managed to work around by going to Settings -> Check for Updates -> Update core database structure

tgtje commented 5 months ago

@brwnie this is correct ( in a way). You copied and replaced files > system runs, however the dbase (present - in time-) does not know if things were changed. Hence an update triggers the dbase to check. The page_metatitle was added to the 2.3.3. core in june 2022, so was not present in 2.3.2. The database (untill trigger) will not check on file change unless something is used (unknown>error). (for maintenance prefered to do manual once a while). Iff you should stumble upon a similar behaviour : do a database check. Using Git versions could behalve in same manner especially using dev mode update). Question remains: how and which files are used? a orig. update pack?

Vodhin commented 5 months ago

This solution did not work for me: I still have an SQL Insert Error.

Update from 2.x to 2.3.3 | โœ”
Update core database structure | โœ”
Add new or missing core settings | โœ”
brwnie commented 5 months ago

@brwnie this is correct ( in a way). You copied and replaced files > system runs, however the dbase (present - in time-) does not know if things were changed. Hence an update triggers the dbase to check. The page_metatitle was added to the 2.3.3. core in june 2022, so was not present in 2.3.2. The database (untill trigger) will not check on file change unless something is used (unknown>error). (for maintenance prefered to do manual once a while). Iff you should stumble upon a similar behaviour : do a database check. Using Git versions could behalve in same manner especially using dev mode update). Question remains: how and which files are used? a orig. update pack?

Indeed, I believe the issue I actually experienced is I was not prompted to update the database as I normally am after copying files over the top of an existing installation.

To answer the question it was the update pack: e107_v2.x_to_2.3.3_upgrade.zip

I can see Vodhin here is still having an issue.

Alex-e107nl commented 5 months ago

I really never use an upgrade package, just take the official 2.3.3 version, (back up the database and files first!) and FTP it over your existing installation, then clear cache, update database (may have to be done several times) and you are completely updated. There may still be a problem with older plugins, but I don't suspect that if you were already working on the 2.x.x version...

If everything works, use the file inspector to delete old files. This should really work because that's how I do it on many e107 websites :-) I'm just not using a higher PHP version than 8.1.27 at the moment.

Please note that if you use the latest Git you can expect problems, a lot of changes to the database!

I hope this helps!

brwnie commented 5 months ago

To 100% clarify I used e107_v2.x_to_2.3.3_upgrade.zip from the e107 release, and copied those files onto my existing installation ๐Ÿ™‚

tgtje commented 5 months ago

@brwnie hard to investigate why no trigger to update was send after upload. core sql had a change, (cron) myisam to innodb..
I have 2.3.3 running (php 8.1) going back to 7.3.3 no issues and page_metatiltle (for dbase) is present in file on update. @Vodhin when you create a page please check on second tab (page options) iff field page_metatitle has title of page + ... iff field not present dbase is not updated properly. (brwnie posted the correct listing how it should be, and yet the error was there, which would now likely post in array [ page_metatitle ] => herestext for seo

For both : i do not know if this would be Ubuntu related, It sometimes happens (from ext. reading) on Maria db

Alex-e107nl commented 5 months ago

tgtje as far as i know the official 2.3.3 does not change myisam to innodb... the github version does...

Jimmi08 commented 5 months ago

Just to be sure - do you have a set option Check for e107 updates once/day in Site Preferences Advanced Features On? Yeah, I had this issue too before.

you can use the direct link e107_admin/e107_update.php

See, no update icon, but the update is there. image

tgtje commented 5 months ago

@Alex-e107nl it is present in off. 2 x to 2.3.3 update pack has date 23-11-2023. the change for Innodb is on part of Cron. I do believe some database servers or phpadmin/cP sometimes hick up when inno runs/in use (hence afaik PDO usage). @Jimmi08 it is an option to use. But unsure the trigger (update) is/was correct in this situation. 2.3.3 had a lot of new/changed files compared to 2.3.2..

Alex-e107nl commented 5 months ago

@tgtje it does not change the myisam to innodb when you update to 2.3.3, even a new install does not use innodb only with the hero table.. e107_admin/db.php?mode=convert_to_utf8

<html><body>
<!--StartFragment-->
e107_admin_log | MyISAM | utf8_general_ci | โœ”
-- | -- | -- | --
e107_audit_log | MyISAM | utf8_general_ci | โœ”
e107_banlist | MyISAM | utf8_general_ci | โœ”
e107_comments | MyISAM | utf8_general_ci | โœ”

<!--EndFragment-->
</body>
</html>

It is only happening after the pull requests of Deltik and they are not in the 2.3.3 official version... Correct me if i am wrong but i have just tested it, so that's not the problem with updating from a previous version to 2.3.3..

I do it regularly and always use the complete version, but I work on a hosting server, not on a local wamp... I will check with the USB web server to see if it also happens there...

tgtje commented 5 months ago

@Alex-e107nl correct, but it does not change the dbase, just the presence of an Innodb table could cause troubles ( out of memory . 1 table always was innodb (user?) and had issues when updating/migrating in the past).So only reflecting, not saying it is the problem.)

Moc commented 5 months ago

The database engine (innodb and utf8mb4) changes were made after the 2.3.3 release, so it is not present in upgrades to 2.3.3 or a fresh install of 2.3.3. Those changes need more testing and fine-tuning first and will be part of the next release.

The bug described here is not related to the upcoming database engine and charset changes but rather an issue either with not properly checking the database structure and/or correcting it or with providing the proper notification.

The symptom in this case is that the page_metatitle field was not added to the database structure and therefore an error message is thrown.

@brwnie are the database updates showing up when manually navigating to the link described by jimmi?

@Deltik any ideas why the database updates are not showing up?

Finally, as a sidenote: Using the update files is perfectly fine. No need for using the new install package.

Deltik commented 5 months ago

@Moc: I saw that @CaMer0n reworked the admin area notifications in https://github.com/e107inc/e107/issues/5106 ยป https://github.com/e107inc/e107/commit/1b697193305b07b35194148db84bfe329dcf2b5f.

It looks like the code that checks for a core database update was removed on this line and no replacement was added (that I could find).

CaMer0n commented 5 months ago

It should be displaying in the upper right corner.

image

tgtje commented 5 months ago

Woww, just made a git sync, (hmm strange behaviour, but works) and YES a 'blinking' bell icon is present. > Testing. Reminder : iff not directly run it will disappear after a few window changes, but going to database update check > waiting for 'run '.

Why just now (missed or..?? ) Thank you

Moc commented 5 months ago

@Vodhin @brwnie Can anyone confirm if the database update message does/did show up? (see screenshot by Cameron above).

brwnie commented 5 months ago

@Vodhin @brwnie Can anyone confirm if the database update message does/did show up? (see screenshot by Cameron above).

After the update? I've always looked out for the notification t after updating e107 but it did not appear in this update for me.

After raising this github issue I went to:

Settings -> Check for Updates, where 'Update core database structure' was clickable. Which fixed the page issue for me.

Vodhin commented 5 months ago

@Vodhin @brwnie Can anyone confirm if the database update message does/did show up? (see screenshot by Cameron above).

Hmmm. I don't think I'm running the same build as others (Version 2.3.3 - Admin Theme: Bootstrap 3 v1.0 by e107). I haven't seen a Bell icon (or a Bug icon or a Mail icon for that matter). Maybe I'm not on a specific page?

tgtje commented 5 months ago

@Vodhin those icons are admin >bell should now be the new (update warning) the bug = debugging yes/no (advanced setting dev mode) mail = pm (if installed). As i already mentioned, it is present (bell) at start after updating, but when you do not notice it, and click on some others first (admin pages), it disappears. After that clicking on database > check updates *as brwnie mentioned also > update button(s) are there. Maybe a colour change (much brighter orange or so) would attract more attention...

Alex-e107nl commented 5 months ago

I have noticed something else, if you check the character set you can also get a database update afterwards... Database Utilities Check Charset...

tgtje commented 5 months ago

@Alex-e107nl correct , although does not happen often. I might be totally wrong, but it happens due to the encoding of a/the file. In meaning : Unix base, ANSI Latin or UTF 8 etc.. in editors in use. Proposed and adequate should be : > UTF-8 and unix line-endings ;-)