[Resolved] UTF8 characters cause "sections" to fail

Home Forums Support [Resolved] UTF8 characters cause "sections" to fail

Home Forums Support UTF8 characters cause "sections" to fail

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #358881
    Adriane

    If we set up “sections” on a page and put content in them, and then add content that includes Hawaiian characters like ā and ʻ that are UTF8 but not latin1, the entire content of the page disappears and a message says there are no sections.

    Is there a database table or some other config that needs to be changed for this to work? Regular posts and WordPress pages work fine, and the wp_posts table columns are all set to UTF8.

    #358922
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I just tested it by copying and pasting those characters: https://www.screencast.com/t/aDJvILZiiR

    And here’s what I see on the front end: https://www.screencast.com/t/o7dyPG87Uk4A

    Do you have any other servers/hosting you can test on?

    #358961
    Adriane

    Yes, there are two other hosts with almost identical installations, including GeneratePress, and they work. But I don’t know which database tables (or other configuration) is different. Which database tables does “sections” use, other than wp_posts?

    #359202
    Tom
    Lead Developer
    Lead Developer

    The content is stored in wp_postmeta, and transferred to wp_posts on save/update as a backup.

    #359365
    Adriane

    Changing the meta_key and meta_value columns to UTF8 collation solved the problem with not being able to use Hawaiian characters on pages using “sections” (probably would have been enough to change meta_value).

    We have another problem with sections that started a few days ago and is probably not related to the collation/character set problem: only the first section shows up on the page when there are multiple sections defined (in Edit Page). This used to work (when not including Hawaiian characters). It is possible there was an auto-update of GeneratePress in the past week. Is this a known problem, and is there a work-around?

    #359369
    Adriane

    This is in the error log and may be related:

    Thu Aug 03 17:00:48.466398 2017] [:error] [pid 2026] [client 98.151.135.107:60329] PHP Warning: Invalid argument supplied for foreach() in /home/sierracl/public_html/mauisierraclub.org/wp-content/plugins/gp-premium/sections/functions/templates/template.php on line 43, referer: https://mauisierraclub.org/wp-admin/post.php?post=1774&action=edit&revision=2075
    [Thu Aug 03 17:00:48.466368 2017] [:error] [pid 2026] [client 98.151.135.107:60329] PHP Warning: Illegal string offset ‘sections’ in /home/sierracl/public_html/mauisierraclub.org/wp-content/plugins/gp-premium/sections/functions/templates/template.php on line 43, referer: https://mauisierraclub.org/wp-admin/post.php?post=1774&action=edit&revision=2075

    #359400
    Tom
    Lead Developer
    Lead Developer

    Hmm, no auto-updates.

    What about when you create a new page? Same issue?

    Those error_log values basically mean that there’s supposed to be sections, but they’re not there.

    Any db changes? Search/replace in the db maybe?

    #359415
    Adriane

    The only changes I made to the DB were to change the collation from latin1 to utf8 on the text columns of wp_posts and wp_post_meta.

    I created a new page now and added three sections. Only the first is visible:

    https://mauisierraclub.org/testing-sections/

    All three sections are visible in Edit Page for that page.

    #359427
    Tom
    Lead Developer
    Lead Developer

    You have this CSS added:

    #generate-section-2, 
    #generate-section-3 {
        display: none;
    }
    #359454
    Adriane

    That solved the problem! Thanks!

    Now I have to find out why that CSS is there to begin with.

    #359455
    Tom
    Lead Developer
    Lead Developer

    That’s always fun! CSS comments are always good 🙂

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.