Skip to content

Not able to publish posts in certain cases on a sub-domain. #11393

Closed

Description

@benoyd

Took me a while to figure this one out. I assumed it was a problem with Advanced Custom Fields 5.8.0 Beta 1 & 2. But it turns out that it's not caused by ACF at all. I have been investigating the issue with Elliot & ACF and we've come to the conclusion that Gutenberg can't publish posts on a sub-domain if a plugin that handle meta fields is activated. I tried a different plugin to see if I could replicate the issue (I could). We tried using this on a regular domain with and without www and everything works as intended.
This error did not occur in Wordpress 4.9.8 with Gutenberg plugin.

Info:
Wordpress 5.0 Beta 2.
Advanced Custom Fields 5.8.0 Beta 1 & Beta 2.
Meta Box 4.15.6 (Tried to replicate with this one).
PHP Version 7.15
twentynineteen theme.

Error that occurs:
500 Internal Server Error when trying to POST to:
/wp-json/wp/v2/posts/27?_locale=user
/wp-json/wp/v2/posts/27/autosaves?_locale=user

How to "circumvent":
Commenting out row 137-143 in wp-includes/l10n.php

Edit: Added theme to info.

Activity

  1. danielbachhuber commented on Nov 2, 2018

    @danielbachhuber
    Member

    Hi @benoyd,

    Can you try reinstalling beta 2? I believe this issue was fixed with https://core.trac.wordpress.org/ticket/45235. Gary rebuilt beta2 but you may have installed the earlier version.

  2. added
    [Status] Needs More Info
    on Nov 2, 2018
  3. benoyd commented on Nov 2, 2018

    @benoyd
    Author

    Hi!

    So I downloaded Wordpress 5.0 Beta 2 (again) and re-downloaded Advanced Custom Fields 5.8.0 Beta 2 (again, just to be sure). And I can still replicate the problem.

    This is what I did now to re-create the same issue:

    1. Install a (clean) Wordpress 5.0 beta 2.
    2. Download and install Advanced Custom Fields 5.8.0 Beta 2.
    3. Activate Plugin (no need to add any blocks or anything).
    4. Try to Create or Edit a post.
    5. Problem occurs when saving or autosaving or publishing (check the network tab).

    NOTE: This was done on a sub domain.

    Howl at me here and I'll get back to you if you need any further information.

  4. danielbachhuber commented on Nov 2, 2018

    @danielbachhuber
    Member
    5\. Problem occurs when saving or autosaving or publishing (check the network tab).
    

    Can you share a screenshot of what you see in this case?

    Also, can you enable your PHP error log and report any contents of that?

  5. benoyd commented on Nov 2, 2018

    @benoyd
    Author

    Sure. This is the screenshots I submitted to ACF (hence the date) but it's the same error.
    https://imgur.com/a/pZxKBX2

    Here is the WP Debug Log:
    [02-Nov-2018 14:23:48 UTC] PHP Notice: Undefined variable: twentynineteen_l10n in C:\www\gutter.test.se\wp-content\themes\twentynineteen\functions.php on line 167
    [02-Nov-2018 14:30:34 UTC] PHP Fatal error: Uncaught Error: Call to undefined function is_user_logged_in() in C:\www\gutter.test.se\wp-includes\l10n.php:137
    Stack trace:
    #0 C:\www\gutter.test.se\wp-includes\l10n.php(1051): determine_locale()
    #1 C:\www\gutter.test.se\wp-includes\l10n.php(1013): _get_path_to_translation_from_lang_dir('acf')
    #2 C:\www\gutter.test.se\wp-includes\l10n.php(983): _get_path_to_translation('acf')
    #3 C:\www\gutter.test.se\wp-includes\l10n.php(1081): _load_textdomain_just_in_time('acf')
    #4 C:\www\gutter.test.se\wp-includes\l10n.php(170): get_translations_for_domain('acf')
    #5 C:\www\gutter.test.se\wp-includes\l10n.php(250): translate('Advanced Custom...', 'acf')
    #6 C:\www\gutter.test.se\wp-content\plugins\advanced-custom-fields-pro\acf.php(80): __('Advanced Custom...', 'acf')
    #7 C:\www\gutter.test.se\wp-content\plugins\advanced-custom-fields-pro\acf.php(692): ACF->initialize()
    #8 C:\www\gutter.test.se\wp-content\plugins\advanced-custom-fields-pro\acf.php(703): acf()
    #9 C:\www\gutter.test.se\wp-settings.php(322): include_once('C:\ in C:\www\gutter.test.se\wp-includes\l10n.php on line 137
    [02-Nov-2018 14:30:44 UTC] PHP Fatal error: Uncaught Error: Call to undefined function is_user_logged_in() in C:\www\gutter.test.se\wp-includes\l10n.php:137
    Stack trace:
    #0 C:\www\gutter.test.se\wp-includes\l10n.php(1051): determine_locale()
    #1 C:\www\gutter.test.se\wp-includes\l10n.php(1013): _get_path_to_translation_from_lang_dir('acf')
    #2 C:\www\gutter.test.se\wp-includes\l10n.php(983): _get_path_to_translation('acf')
    #3 C:\www\gutter.test.se\wp-includes\l10n.php(1081): _load_textdomain_just_in_time('acf')
    #4 C:\www\gutter.test.se\wp-includes\l10n.php(170): get_translations_for_domain('acf')
    #5 C:\www\gutter.test.se\wp-includes\l10n.php(250): translate('Advanced Custom...', 'acf')
    #6 C:\www\gutter.test.se\wp-content\plugins\advanced-custom-fields-pro\acf.php(80): __('Advanced Custom...', 'acf')
    #7 C:\www\gutter.test.se\wp-content\plugins\advanced-custom-fields-pro\acf.php(692): ACF->initialize()
    #8 C:\www\gutter.test.se\wp-content\plugins\advanced-custom-fields-pro\acf.php(703): acf()
    #9 C:\www\gutter.test.se\wp-settings.php(322): include_once('C:\ in C:\www\gutter.test.se\wp-includes\l10n.php on line 137

  6. danielbachhuber commented on Nov 2, 2018

    @danielbachhuber
    Member

    Hey @benoyd,

    This was the issue that was fixed in beta2. I'm not sure why you're not getting the new build, but should be addressed when beta3 is released at the minimum.

  7. added
    Needs Testing
    and removed
    [Status] Needs More Info
    on Nov 2, 2018
  8. benoyd commented on Nov 5, 2018

    @benoyd
    Author

    Sorry for the late response. This is the link I used to download the Beta: https://wordpress.org/wordpress-5.0-beta2.zip I downloaded it 2018-11-02 15:20 European Standard Time.

    I wish I could try Beta 3 that got released, but I'm hestitanting to upgrade since Elliot on ACF reported that the new beta does not save ACF Meta Data fields at all. So I'll have wait til that is fixed, more info here: https://wordpress.org/support/topic/wordpress-5-0-beta3-does-not-save-acf-metabox-data/

  9. ellatrix commented on Jun 24, 2019

    @ellatrix
    Member

    What's the status of this issue? Has it been fixed, @benoyd?

  10. added
    [Status] Needs More Info
    on Jun 24, 2019
  11. benoyd commented on Jun 24, 2019

    @benoyd
    Author

    Yes, this is no longer an issue :)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Testing[Status] Needs More Info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions