Closed yorkshire-pudding closed 1 year ago
@yorkshire-pudding It's a bit strange, but when I begin testing on a vanilla install, if I create a Paragraphs type with very little info and no fields, and then clone it, I get this status message that looks incomplete:
And in the watchdog:
Notice: Undefined index: source_name in paragraphs_type_clone_finished() (line 392 of /app/web/modules/paragraphs/paragraphs.type_clone.inc). Notice: Undefined index: target_name in paragraphs_type_clone_finished() (line 393 of /app/web/modules/paragraphs/paragraphs.type_clone.inc). Notice: Undefined index: field_count in paragraphs_type_clone_finished() (line 394 of /app/web/modules/paragraphs/paragraphs.type_clone.inc).
This happens if I clone any Paragraphs type immediately after creating it. I guess it's a cache issue somewhere along the way?
This happens if I clone any Paragraphs type immediately after creating it. I guess it's a cache issue somewhere along the way?
This happens when the paragraph to be cloned has no fields attached to it. It's harmless, but can be prevented in the code.
Thanks @laryn - I've made changes as suggested.
Now handles clone without fields.
Great, @yorkshire-pudding! My only minor suggestion is to use $form_state['redirect']
instead of backdrop_goto
(you'll need an else
statement too to set the batch). I read somewhere that redirect
is the recommended way, as the form processor finishes doing its thing when you use it, instead of backdrop_goto
but I may be wrong...
@yorkshire-pudding I think we're looking good! The suggestion from @argiepiano sounds right, so once that's complete given his review and my own I think we're set to merge.
Thanks @laryn and @argiepiano - that change is done.
Fixes #149