octobercms / october

Self-hosted CMS platform based on the Laravel PHP Framework.
https://octobercms.com/
Other
11.04k stars 2.21k forks source link

[Bug ?] Checkbox in components #928

Closed tiipiik closed 9 years ago

tiipiik commented 9 years ago

When using a checkbox in a component there is a bug (for me at all, if someone could validate it would be greate)

To test: Opening a CMS page, adding a component, click on the component to open it's parameter's, then click outside the parameter's component and then click again on the component to open it's parameters. You should see that fields are empty and style has bugs too.

SASniper commented 9 years ago

Hey there Yohann,

I've just followed your steps and came across the same issue as yourself. In my case I used the Component ProBlog ProBlogList. Add the component, open it's parameters change a checkbox and either hit close or click off the popup results in all of the parameters being empty


Steven Walker stevenwalker.eu

On 5 February 2015 at 09:25, Yohann Decharraud notifications@github.com wrote:

When using a checkbox in a component there is a bug (for me at all, if someone could validate it would be greate)

To test: Opening a CMS page, adding a component, click on the component to open it's parameter's, then click outside the parameter's component and then click again on the component to open it's parameters. You should see that fields are empty and style has bugs too.

— Reply to this email directly or view it on GitHub https://github.com/octobercms/october/issues/928.

tiipiik commented 9 years ago

Thank you SASniper,

Thanks for validating that !

I told that to daftpunk. As they are in Laravel5 upgrade they will take a look at that after the RC.

DanielHitchen commented 9 years ago

I came across this also in some of my plugins - can you just check that in the component defineProperties() that any options for showExternalParameter have been changed to showExternalParam, as this is what was tripping my plugins up?

tiipiik commented 9 years ago

I don't have any showExternalParam in my plugins, and there's no one in the Blog (Rainlab) plugin.

riuson commented 9 years ago

I have defined property of type 'checkbox' in custom component and came to the same problem. Then I set checkbox to checked state and open properties again, all values are empty.

public function defineProperties()
{
    return [
        'showAll' => [
            'description' => 'Show status messages for all users',
            'title' => 'Show All',
            'default' => false,
            'type' => 'checkbox'
        ]
    ];
}
t2t2 commented 9 years ago

I think I found the bug, it's the inspector javascript assuming the values are strings:

octobercms_inspector_exception
TypeError: propertyValue.match is not a function

(above happened just by adding demoTodo component and on first open)

Related file: october/modules/backend/assets/js/october.inspector.js

Reproduction steps: Have a default value for property that isn't a string, or if type=checkbox, having it be checked leads to true value

FirestarterUA commented 9 years ago

Ocotber 2.71, Chrome 43.0.2357.130 m , Multiple checkboxes in params. After the second click into component, have the same: empty fields. bag

rjchauhan commented 9 years ago

Yes, I found same issue in my plugin too. After second click it shows empty fields on component and javascript errors.

CptMeatball commented 9 years ago

I've experienced similar problems. Component settings appear empty on opening the component directly after drag & drop into page.

daftspunk commented 9 years ago

This issue has been fixed in the latest build (Build 30x) as the component plugin has been rebuilt