CE Cache
ExpressionEngine 2, ExpressionEngine 3
Back to this add-on's main page
View Other Add-ons From Causing Effect
EE2 - Channel Form Hook PHP Notice
Bug (Resolved)
hypatia-industries
|
Posted: 25 April 2017 07:03 PM |
|
|
|
Hey Aaron,
Thanks for getting CE Cache updated to work with EE3. I’ll be updating my clients’ sites now that it’s available. Really appreciate it.
I ran into a bug with CE Cache 1.11.0 today though after updating. When submitting the following Channel Form:
{exp:channel:form channel="channel_name" id="formID" json="yes" include_jquery="no" include_assets="no"} <input type="hidden" name="title" value="test submission" /> <input type="submit" value="submit" /> {/exp:channel:form}
I receive the following PHP error:
Message: Missing argument 2 for Ce_cache_ext::hook_channel_form_submit_entry_end()
This only happens when I have the form’s json=“yes” parameter set. If I remove it, the form submits error-free. Now, the form is being posted to the database fine even when the error is being thrown. However, I’m making this post via AJAX and I need to manipulate the JSON that gets returned. And since the error is being thrown, the returned “JSON” is really the HTML output of the error, followed by the JSON returned by the form.
Any help would be greatly appreciated.
EE 2.11.9
Thanks,
Earl
|
|
|
Adam Khan
|
Posted: 26 April 2017 12:14 PM |
# 1
|
|
|
I have precisely the same issue! Looks like it was introduced after upgrading CE Cache from 1.10.1 to 1.11.1. I get the following 2 errors:
A PHP Error was encountered
Severity: Warning
Message: Missing argument 2 for Ce_cache_ext::hook_channel_form_submit_entry_end()
Filename: ce_cache/ext.ce_cache.php
Line Number: 140
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: data
Filename: ce_cache/ext.ce_cache.php
Line Number: 147
Hope you can help.
In the meantime, since I’m not caching any forms anyway, I’ve just hacked the file to make this public function do nothing, ie:
public function hook_channel_form_submit_entry_end( ) {}
And this seems to have done the trick for now.
|
|
|
Causing Effect - Aaron Waldon
|
Posted: 27 April 2017 04:19 PM |
# 2
|
|
Developer
|
Hi hypatia-industries and Adam!
Thank you for making me aware of this issue. I think you can swap out this:
/** * Called when Channel Form entries are published or edited. * * @param array $user_selected_options * @param array $data * @return mixed */ public function hook_channel_form_submit_entry_end( $user_selected_options, $data ) { if ( isset( $data->entry['entry_id'] ) ) { $this->break_cache( $data->entry['entry_id'] ); }
return $data; }
with this:
/** * Called when Channel Form entries are published or edited. * * @param array $data * @return void */ public function hook_channel_form_submit_entry_end( $data ) { if ( isset( $data->entry['entry_id'] ) ) { $this->break_cache( $data->entry['entry_id'] ); } }
I’ll do some testing and try to get an update out in the next couple of days.
Regards,
Aaron
|
|
|
Causing Effect - Aaron Waldon
|
Posted: 01 May 2017 03:03 PM |
# 3
|
|
Developer
|
Version 1.11.2 for EE2 was just released, which should take care of this issue. :)
|
|
|
hypatia-industries
|
Posted: 02 May 2017 07:30 PM |
# 4
|
|
|
Cool, thanks for the quick fix Aaron. That totally solved it, appreciate it.
|
|
|
Adam Khan
|
Posted: 03 May 2017 01:32 PM |
# 5
|
|
|
Great stuff.
Separately (I’m guessing), I’m getting this error when doing a batch edit in Zenbu:
Unable to locate the model you have specified: ce_cache_break_model
Presumably something to take up with the Zenbu maestro?
|
|
|
nacnewmedia
|
Posted: 18 October 2017 10:15 AM |
# 6
|
|
|
I’m getting this same error using 1.11.2 upon editing multiple entries: “Unable to locate the model you have specified: ce_cache_break_model” – will make a new report… here it is
|
|
|