Support

Home Forums Event Espresso Premium PHP Warning in debug log

PHP Warning in debug log

Posted: October 4, 2024 at 2:51 pm

Viewing 1 reply thread


lwregistrations

October 4, 2024 at 2:51 pm

Hi,

I have written a plugin to pull registration data as attendees register in order to put their data into our separate app. I am running Event Espresso 5.0.21.p. My php version is 7.4.

When I try a single registration, everything works great.
When I try registering more than one attendee in a transaction, it also works great. EXCEPT, I get this error in my debug.log:
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/locworld/public_html/sandbox/wp-content/plugins/attachments/classes/class.attachments.search.php on line 64

My code hasn’t changed between the two cases, but obviously, more of it is getting executed. I have:
if ($transaction instanceof EE_Transaction)
{
$registrations = $transaction->registrations();
try {
… (preparing SOAP data for sending) then:
foreach ($registrations as $registration)
{
if ( $registration instanceof EE_Registration )
{
$attendee = $registration->attendee();
$attendeeID = “https://www.jujama.com/MyQRCode/Person/Id/LW52-“.$attendee->ID();
$fname = $attendee->fname();
(etc)

As I stated above, everything actually works fine. It’s just that I get the warning in the debug log, which I am concerned might come back to bite me. I have run the health check, and nothing jumps out.

Any thoughts/suggestions?

Thank you.
Donna


Tony

  • Support Staff

October 4, 2024 at 3:01 pm

Hi Donna,

Your above code doesn’t call count() and that warning looks like its from this plugin:

https://wordpress.org/plugins/attachments/

Which isn’t related to your code (unless your calling something to call the above plugin?)

Is that the correct ‘error’ you included here?

Viewing 1 reply thread

You must be logged in to reply to this support post. Sign In or Register for an Account

Event Espresso