Jump to content

[Solved] Fields to inherit TinyMCE settings from lead to fatal error in PW backend


Klenkes
 Share

Recommended Posts

Two fields of type TinyMCE called blocktext_text_1 and blocktext_text_2
blocktext_text_2 should inherit its settings from blocktext_text_1.

Now...
Editing the page under RockPageBuilderBlocks it works
Editing the block in the frontend modal it works.
Editing the PW page(in backend like About Us) I get a fatal error.

Spoiler

Fatal Error: Uncaught Error: Call to a member function hasFieldContext() on null in D:\Projekte\kopfleere\processwire-rock\www\wire\modules\Inputfield\InputfieldTinyMCE\InputfieldTinyMCESettings.php:818

#0 D:\Projekte\kopfleere\processwire-rock\www\wire\modules\Inputfield\InputfieldTinyMCE\InputfieldTinyMCE.module.php(559): InputfieldTinyMCESettings->applySettingsField('blocktext_text_...')
#1 D:\Projekte\kopfleere\processwire-rock\www\site\modules\RockPageBuilder\InputfieldRockPageBuilder.module.php(82): InputfieldTinyMCE->renderReady()
#2 D:\Projekte\kopfleere\processwire-rock\www\site\modules\RockPageBuilder\InputfieldRockPageBuilder.module.php(307): InputfieldRockPageBuilder->preloadBlockAssets()
#3 D:\Projekte\kopfleere\processwire-rock\www\wire\core\InputfieldWrapper.php(1070): InputfieldRockPageBuilder->renderReady(Object(InputfieldWrapper), false)
#4 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(419): InputfieldWrapper->___renderInputfield(Object(InputfieldRockPageBuilder), false)
#5 D:\Projekte\kopfleere\processwire-rock\www\wire\core\WireHooks.php(968): Wire->_callMethod('___renderInputf...', Array)
#6 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(484): WireHooks->runHooks(Object(InputfieldWrapper), 'renderInputfiel...', Array)
#7 D:\Projekte\kopfleere\processwire-rock\www\wire\core\InputfieldWrapper.php(768): Wire->__call('renderInputfiel...', Array)
#8 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(413): InputfieldWrapper->___render()
#9 D:\Projekte\kopfleere\processwire-rock\www\wire\core\WireHooks.php(968): Wire->_callMethod('___render', Array)
#10 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(484): WireHooks->runHooks(Object(InputfieldWrapper), 'render', Array)
#11 D:\Projekte\kopfleere\processwire-rock\www\wire\core\InputfieldWrapper.php(1097): Wire->__call('render', Array)
#12 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(419): InputfieldWrapper->___renderInputfield(Object(InputfieldWrapper), false)
#13 D:\Projekte\kopfleere\processwire-rock\www\wire\core\WireHooks.php(968): Wire->_callMethod('___renderInputf...', Array)
#14 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(484): WireHooks->runHooks(Object(InputfieldForm), 'renderInputfiel...', Array)
#15 D:\Projekte\kopfleere\processwire-rock\www\wire\core\InputfieldWrapper.php(768): Wire->__call('renderInputfiel...', Array)
#16 D:\Projekte\kopfleere\processwire-rock\www\wire\modules\Inputfield\InputfieldForm.module(187): InputfieldWrapper->___render()
#17 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(413): InputfieldForm->___render()
#18 D:\Projekte\kopfleere\processwire-rock\www\wire\core\WireHooks.php(968): Wire->_callMethod('___render', Array)
#19 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(484): WireHooks->runHooks(Object(InputfieldForm), 'render', Array)
#20 D:\Projekte\kopfleere\processwire-rock\www\wire\modules\Process\ProcessPageEdit\ProcessPageEdit.module(610): Wire->__call('render', Array)
#21 D:\Projekte\kopfleere\processwire-rock\www\wire\modules\Process\ProcessPageEdit\ProcessPageEdit.module(576): ProcessPageEdit->renderEdit()
#22 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(413): ProcessPageEdit->___execute()
#23 D:\Projekte\kopfleere\processwire-rock\www\wire\core\WireHooks.php(968): Wire->_callMethod('___execute', Array)
#24 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(484): WireHooks->runHooks(Object(ProcessPageEdit), 'execute', Array)
#25 D:\Projekte\kopfleere\processwire-rock\www\wire\core\ProcessController.php(361): Wire->__call('execute', Array)
#26 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(413): ProcessController->___execute()
#27 D:\Projekte\kopfleere\processwire-rock\www\wire\core\WireHooks.php(968): Wire->_callMethod('___execute', Array)
#28 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(484): WireHooks->runHooks(Object(ProcessController), 'execute', Array)
#29 D:\Projekte\kopfleere\processwire-rock\www\wire\core\admin.php(160): Wire->__call('execute', Array)
#30 D:\Projekte\kopfleere\processwire-rock\www\site\templates\admin.php(15): require('D:\\Projekte\\kop...')
#31 D:\Projekte\kopfleere\processwire-rock\www\wire\core\TemplateFile.php(328): require('D:\\Projekte\\kop...')
#32 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(413): TemplateFile->___render()
#33 D:\Projekte\kopfleere\processwire-rock\www\wire\core\WireHooks.php(968): Wire->_callMethod('___render', Array)
#34 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(484): WireHooks->runHooks(Object(TemplateFile), 'render', Array)
#35 D:\Projekte\kopfleere\processwire-rock\www\wire\modules\PageRender.module(575): Wire->__call('render', Array)
#36 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(416): PageRender->___renderPage(Object(HookEvent))
#37 D:\Projekte\kopfleere\processwire-rock\www\wire\core\WireHooks.php(968): Wire->_callMethod('___renderPage', Array)
#38 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(484): WireHooks->runHooks(Object(PageRender), 'renderPage', Array)
#39 D:\Projekte\kopfleere\processwire-rock\www\wire\core\WireHooks.php(1094): Wire->__call('renderPage', Array)
#40 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(484): WireHooks->runHooks(Object(Page), 'render', Array)
#41 D:\Projekte\kopfleere\processwire-rock\www\wire\modules\Process\ProcessPageView.module(184): Wire->__call('render', Array)
#42 D:\Projekte\kopfleere\processwire-rock\www\wire\modules\Process\ProcessPageView.module(114): ProcessPageView->renderPage(Object(Page), Object(PagesRequest))
#43 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(416): ProcessPageView->___execute(true)
#44 D:\Projekte\kopfleere\processwire-rock\www\wire\core\WireHooks.php(968): Wire->_callMethod('___execute', Array)
#45 D:\Projekte\kopfleere\processwire-rock\www\wire\core\Wire.php(484): WireHooks->runHooks(Object(ProcessPageView), 'execute', Array)
#46 D:\Projekte\kopfleere\processwire-rock\www\index.php(55): Wire->__call('execute', Array)
#47 {main}
thrown (line 818 of D:\Projekte\kopfleere\processwire-rock\www\wire\modules\Inputfield\InputfieldTinyMCE\InputfieldTinyMCESettings.php)

This error message was shown because: you are logged in as a Superuser. Error has been logged.

If it helps... the migration code of blocktext_text_1

Spoiler
'blocktext_text_1' => [
  'label' => 'Blocktext 1',
  'flags' => 0,
  'type' => 'FieldtypeTextarea',
  'inputfieldClass' => 'InputfieldTinyMCE',
  'contentType' => 1,
  'inlineMode' => 0,
  'height' => 300,
  'lazyMode' => 1,
  'features' => [
    0 => 'toolbar',
    1 => 'menubar',
    2 => 'purifier',
    3 => 'pasteFilter',
  ],
  'toolbar' => 'styles bold italic strikethrough charmap pwlink pwimage bullist numlist anchor code',
  'plugins' => [
    0 => 'anchor',
    1 => 'charmap',
    2 => 'code',
    3 => 'link',
    4 => 'lists',
    5 => 'pwimage',
    6 => 'pwlink',
  ],
  'minlength' => 0,
  'maxlength' => 0,
  'showCount' => 0,
  'rows' => 15,
  'htmlOptions' => [
    0 => 2,
    1 => 4,
    2 => 8,
  ],
  'toggles' => [
    0 => 2,
    1 => 4,
  ],
  'columnWidth' => 50,
  'tags' => '',
  'textformatters' => '',
  'settingsField' => '',
  'extPlugins' => '',
  'settingsJSON' => '',
  'settingsFile' => '',
  'collapsed' => 0,
  'showIf' => '',
  'themeInputSize' => '',
  'themeOffset' => '',
  'themeBorder' => '',
  'themeColor' => '',
  'themeBlank' => '',
  'required' => '',
  'requiredAttr' => '',
  'requiredIf' => '',
  'stripTags' => '',
  'placeholder' => '',
]

PW 3.0.226 | RPB 4.8.0

 

Link to comment
Share on other sites

@Klenkes thx for the report. Seems you are trying out things that all of us have never been using over the last 3 years ?

Could you please try changing line 81 from $nullpage to $block:

$f = $field->getInputfield($block);

Edit: Sent you the new version as PM, please check ? 

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
  • Klenkes changed the title to [Solved] Fields to inherit TinyMCE settings from lead to fatal error in PW backend

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...