Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Javascript error preventing setting atom field type or adding new atoms.

Status Resolved
Add-on / Version Bloqs 4.0.15
Severity
EE Version 5.1.0

Jarod Clark

Dec 21, 2018

Hello, I’m having issues with Bloqs on a site just upgraded to EE 5.1.0.

When trying to set the field type for an Atom, or add a new Atom, there are javascript errors that prevent those functions from working.

Here’s what comes from selecting a field type:

admin.php?S=0&D=cp&C=javascript&M=combo_load&ui=core,widget,mouse,position,sortable,dialog,button&plugin=ee_interact.event,ee_broadcast.event,ee_notice,ee_txtarea,tablesorter,ee_toggle_all,nestable&file=react/react.min,react/react-dom.min,json2,underscore,cp/global_start,cp/form_validation,cp/sort_helper,cp/form_group,cp/modal_form,cp/confirm_remove,cp/fuzzy_filters,components/no_results,components/loading,components/filters,components/filterable,components/toggle,components/select_list,fields/select/select,fields/select/mutable_select,fields/dropdown/dropdown&v=1545406984:171 TypeError: Cannot read property 'replace' of undefined
    at e.Settings._swapNamespace (admin.php?S=0&D=cp&C=javascript&M=combo_load&plugin=ee_table_reorder,ee_url_title&file=cp/grid,fields/relationship/settings&v=1545406984:29)
    at HTMLInputElement.<anonymous> (admin.php?S=0&D=cp&C=javascript&M=combo_load&plugin=ee_table_reorder,ee_url_title&file=cp/grid,fields/relationship/settings&v=1545406984:29)
    at HTMLDivElement.dispatch (jquery.js?v=1545406984:3)
    at HTMLDivElement.v.handle (jquery.js?v=1545406984:3)
    at Object.trigger (jquery.js?v=1545406984:4)
    at HTMLInputElement.<anonymous> (jquery.js?v=1545406984:4)
    at Function.each (jquery.js?v=1545406984:2)
    at oe.fn.init.each (jquery.js?v=1545406984:2)
    at oe.fn.init.trigger (jquery.js?v=1545406984:4)
    at t.value (admin.php?S=0&D=cp&C=javascript&M=combo_load&ui=core,widget,mouse,position,sortable,dialog,button&plugin=ee_interact.event,ee_broadcast.event,ee_notice,ee_txtarea,tablesorter,ee_toggle_all,nestable&file=react/react.min,react/react-dom.min,json2,underscore,cp/global_start,cp/form_validation,cp/sort_helper,cp/form_group,cp/modal_form,cp/confirm_remove,cp/fuzzy_filters,components/no_results,components/loading,components/filters,components/filterable,components/toggle,components/select_list,fields/select/select,fields/select/mutable_select,fields/dropdown/dropdown&v=1545406984:343)

And here’s what happens when trying to add a new Atom:

admin.php?S=0&D=cp&C=javascript&M=combo_load&plugin=ee_table_reorder,ee_url_title&file=cp/grid,fields/relationship/settings&v=1545406984:29 Uncaught TypeError: Cannot read property 'replace' of undefined
    at e.Settings._swapNamespace (admin.php?S=0&D=cp&C=javascript&M=combo_load&plugin=ee_table_reorder,ee_url_title&file=cp/grid,fields/relationship/settings&v=1545406984:29)
    at e.Settings._buildNewColumn (admin.php?S=0&D=cp&C=javascript&M=combo_load&plugin=ee_table_reorder,ee_url_title&file=cp/grid,fields/relationship/settings&v=1545406984:29)
    at HTMLAnchorElement.<anonymous> (admin.php?S=0&D=cp&C=javascript&M=combo_load&plugin=ee_table_reorder,ee_url_title&file=cp/grid,fields/relationship/settings&v=1545406984:29)
    at HTMLAnchorElement.dispatch (jquery.js?v=1545406984:3)
    at HTMLAnchorElement.v.handle (jquery.js?v=1545406984:3)
#1

BoldMinded (Brian)

What do you mean by “When trying to set the field type for an Atom, or add a new Atom” - when you’re adding a new atom to an existing block, or when adding a block to an entry?

#2

Jarod Clark

Sorry, when creating a new Bloq type and defining what the fields/atoms are.

#3

Jarod Clark

Comment has been marked private.

#4

BoldMinded (Brian)

Yeaaaah. I’m seeing it locally too. Thanks for the report, I’ll see what I can do about fixing it.

#5

BoldMinded (Brian)

Ok, find the bloqs/views/ee4/cp-atomdefinitions.php file and change it to this:

<div class="fields-grid-setup ui-sortable" data-group="grid"><!-- grid-wrap -->
    <?php foreach ($columns as $column): ?>
        <?=$column?>
    <?php endforeach ?>
</div>

<div id="grid_col_settings_elements" data-group="always-hidden" class="hidden">
<?php
use Basee\App;
$className = App::isGteEE5() ? 'grid-col-settings-elements' : 'grid_col_settings_elements';
?>

<div class="grid-col-settings-elements" data-group="always-hidden" class="hidden"  none">
    <?=$blank_col?>

    <?php foreach ($settings_forms as $form): ?>
        <?=$form?>
    <?php endforeach ?>
</div>

Let me know if that works out for you.

#6

BoldMinded (Brian)

That was a bad copy/paste use this instead:

<div class="fields-grid-setup ui-sortable" data-group="grid"><!-- grid-wrap -->
    <?php foreach ($columns as $column): ?>
        <?=$column?>
    <?php endforeach ?>
</div>

<?php
use Basee\App;
$className = App::isGteEE5() ? 'grid-col-settings-elements' : 'grid_col_settings_elements';
?>

<div class="grid-col-settings-elements" data-group="always-hidden" class="hidden"  none">
    <?=$blank_col?>

    <?php foreach ($settings_forms as $form): ?>
        <?=$form?>
    <?php endforeach ?>
</div>
#7

BoldMinded (Brian)

Good lord, it’s stripping style tags. Use this: https://gist.github.com/litzinger/6cfdd06304df85bc5337bc5c7b7b3483

#8

Jarod Clark

Gotta love that!

Looks like that update worked.

#9

BoldMinded (Brian)

Good to hear!

#10

BoldMinded (Brian)

Comment has been marked private.

#11

BoldMinded (Brian)

Fixed in 4.0.16 and released.

Login to reply