wp-papi / papi

:rocket: WordPress Page Type API with custom fields
https://wp-papi.github.io
MIT License
263 stars 32 forks source link

[bug] - Editor property #201

Closed nlemoine closed 8 years ago

nlemoine commented 8 years ago

Description

When using more than one editor property in a flexible, the first one is but the others editors are not rendered correctly. They are stuck on the "text" tab, "visual" tab can't be clicked.

Steps to reproduce

papi_property( [
  'title'    => 'Flexible',
  'slug'     => 'my_flexible_slug',
  'type'     => 'flexible',
  'settings' => [
    'items' => [
      [
        'title' => 'Posts',
        'items' => [
          papi_property( [
            'type'  => 'editor',
            'title' => 'Title',
            'slug'  => 'my_string_slug'
          ] ),
          papi_property( [
            'type'  => 'editor',
            'title' => 'Post',
            'slug'  => 'my_post_slug'
          ] )
        ]
      ],
    ]
  ]
] )

What versions of softwares are you using?

frozzare commented 8 years ago

Is this only a problem in master branch or a problem with the latest stable version? Note that master branch is unstable and should not be used on real sites :)

nlemoine commented 8 years ago

Sorry, confirmed with 3.1.15 ;)

frozzare commented 8 years ago
skarmklipp 2016-10-23 12 57 51

Isn't this right? Both are rendered with visual tab and both text tabs can be clicked. Tested with 3.x branch (that will be 3.1.16).

nlemoine commented 8 years ago

I didn't think the layout could be involved but the bug only occurs when layout is set to vertical:

papi_property( [
  'title'    => 'Flexible',
  'slug'     => 'my_flexible_slug',
  'type'     => 'flexible',
  'settings' => [
    'layout' => 'vertical',
    'items' => [
      [
        'title' => 'Posts',
        'items' => [
          papi_property( [
            'type'  => 'editor',
            'title' => 'Title',
            'slug'  => 'my_string_slug'
          ] ),
          papi_property( [
            'type'  => 'editor',
            'title' => 'Post',
            'slug'  => 'my_post_slug'
          ] )
        ]
      ],
    ]
  ]
] )
frozzare commented 8 years ago

Yeah, that did cause the bug. The problem was that it assume that it was a tbody around both properties and not a single on when vertical layout is used. So the editors did get the same id and that isn't ok with tinmyce.

Fixed in 3.x and master and will be out in next 3.x versions coming soon.

nlemoine commented 8 years ago

Thanks! 👍

frozzare commented 8 years ago

Is this only a problem in master branch or a problem with the latest stable version? Master branch is unstable and should not be used.

On 21 okt. 2016 12:58 +0200, Nico notifications@github.com, wrote:

Description

When using more than one editor property in a flexible, the second editor is not rendered correctly. The second field is stuck on the "text" tab, "visual" tab can't be clicked.

Steps to reproduce papi_property( [ 'title' => 'Flexible', 'slug' => 'my_flexible_slug', 'type' => 'flexible', 'settings' => [ 'items' => [ [ 'title' => 'Posts', 'items' => [ papi_property( [ 'type' => 'editor', 'title' => 'Title', 'slug' => 'my_string_slug' ] ), papi_property( [ 'type' => 'editor', 'title' => 'Post', 'slug' => 'my_post_slug' ] ) ] ], ] ] )

What versions of softwares are you using? Browser: Chrome latest Papi: dev-master WordPress: latest

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub (https://github.com/wp-papi/papi/issues/201), or mute the thread (https://github.com/notifications/unsubscribe-auth/AAA5EkMLv9GBXK2xC-t-WMzACfOYktT7ks5q2JrDgaJpZM4KdHGB).

nlemoine commented 8 years ago

The issue has already been resolved.

frozzare commented 8 years ago

@nlemoine the email did get stuck on my phone last week, sorry for that.

nlemoine commented 8 years ago

No problem ;)