Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save button in FSE is always active for all pages and posts despite no changes were made #684

Closed
larixer opened this issue Jul 25, 2024 · 4 comments

Comments

@larixer
Copy link

larixer commented Jul 25, 2024

Describe the bug
Save button in FSE is always active for all pages and posts despite no changes were made

How to reproduce the bug

  1. Put provided docker-compose.yml into some directory for testing clean Wordpress install:
services:
  db:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
  wordpress:
    image: wordpress:6.6.1-php8.3-apache
    depends_on:
      - db
    ports:
      - 6050:80
    volumes:
      - ./wordpress:/var/www/html
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
volumes:
  mysql:
  1. docker compose up
  2. Go to http://localhost:6050 and install Wordpress.
  3. Log into admin area via http://localhost:6050/wp-admin
  4. Go to Posts in the sidebar and edit Hello world post, notice that Save button is greyed out when you started to edit post
  5. Add The SEO Framework plugin
  6. Go to Posts in the sidebar and edit Hello world post, notice that Save button is active. Click Save, it is still active. It never gets greyed out.

Expected behavior

I expect Save button to be greyed out when no changes were made to the Post/Page since last save.

Screenshots

Not applicable.

Additional context

Wordpress: 6.6.1
The SEO Framework 5.0.6

@larixer larixer changed the title Save button in FSA is always active for all pages and posts despite no changes were made Save button in FSE is always active for all pages and posts despite no changes were made Jul 25, 2024
@larixer
Copy link
Author

larixer commented Jul 25, 2024

Additional information:

Issue is gone if one comments out this line:

\add_action( 'add_meta_boxes', [ Admin\Settings\Post::class, 'prepare_meta_box' ] );

@sybrew sybrew self-assigned this Jul 25, 2024
@sybrew sybrew added this to the 5.0.7 milestone Jul 25, 2024
@sybrew
Copy link
Owner

sybrew commented Jul 25, 2024

Thanks for the report! I still need to verify this, but it sounds like something TSF could do.

@sybrew
Copy link
Owner

sybrew commented Jul 28, 2024

This appears to be a feature of Gutenberg / Block Editor.

When any meta box is shown (even the native Custom Fields one), the Save button will never be disabled.
This is likely because they cannot accurately determine if the meta box's contents have changed.

To bypass this, we'd have to integrate our meta fields into Gutenberg's sidebar rather than via a meta box. The realization of this is still ongoing.

@larixer
Copy link
Author

larixer commented Jul 29, 2024

Thank you @sybrew, relevant Gutenberg discussion:
WordPress/gutenberg#4184

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

No branches or pull requests

2 participants