when there is no entry to get, the function didn't created an empty array and returned it, it just returned an undefined object.
with the fix it will return an empty array;
The change is to add the following line in kaltura.admin.inc:
$returned_entries = array();

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xurizaemon’s picture

Status: Active » Postponed (maintainer needs more info)

Thanks Noa, this patch looks good.

I'd like to test it out first though - can you please detail exactly the steps to duplicate this error so the fix can be tested?

noa.issler’s picture

Title: kaltura_get_my_entries - throw exception of given null and not an array » two bug fix: import argument is not array and kaltura notifications deleting tags
Issue tags: +kaltura
FileSize
110.54 KB

attached now the new patch of the first original bug and another one.

bug 1:
in your drupal site under index.php?q=admin/settings/kaltura/import
you get the following message in red (not always only when there is nothing to import):
warning: array_merge() [function.array-merge]: Argument #3 is not an array in /var/www/vhosts/kanopystreaming.com/httpdocs/RMIT/modules/kaltura/includes/kaltura.admin.inc on line 769.

bug 2:
the notifications from kalturas' servers where deleting tags and admin tags from node_kaltura table.

gonen.radai_kaltura’s picture

I think that the correct patch for the #2 bug is the attached patch.
however - I'm not yet sure this fix is full-proof yet, I've witnessed tags still being cleared although this fix was applied.

Gonen

xurizaemon’s picture

@noa.issler - sorry to be a pain but the patch in #1 is 446b and the patch in #2 is 110Kb ... a bit of a leap.

Can you please
(1) file your tag deletion patch against a separate issue (I don't believe one exists yet for this), and
(2) make sure patches you submit contain only the lines of code actually changed?

Might be that you're doing a whitespace cleanup for coding standards (I know some areas of the module are a mess, #850378: Coding standards... already exists for this). If so, please keep such patches separate from patches which affect how the code works.

Thanks again - really do appreciate your contributions, and hope you understand how the Drupal's patch guidelines exist to help module maintainers help you :)

xurizaemon’s picture

Title: two bug fix: import argument is not array and kaltura notifications deleting tags » kaltura_get_my_entries() throws exception when $returned_entries is not set

Resetting issue title to original issue.

patrickroma’s picture

I can confirm this behaviour: When there is no entry to import the following error is shown:
warning: array_merge() [function.array-merge]: Argument #2 is not an array in blala/mysite/sites/all/modules/kaltura/includes/kaltura.admin.inc on line 747

Does the patch above solve this issue?

xurizaemon’s picture

Status: Postponed (maintainer needs more info) » Needs review
Issue tags: -kaltura
FileSize
3.99 KB

@patrickroma - please try the attached patch for the array_merge() issue at admin/settings/kaltura/entries/import when no new items are present on Kaltura server

patrickroma’s picture

Yes, the Patch Solves the situation.

patrickroma’s picture

Yes, the Patch Solves the situation.

xurizaemon’s picture

Title: kaltura_get_my_entries() throws exception when $returned_entries is not set » warning: array_merge() Argument #2 is not an array when no entry to import at admin/settings/kaltura/entries/import
Assigned: Unassigned » xurizaemon
Status: Needs review » Fixed

I've committed the patch in #7 for the array_merge issue (noa's bug #1) now and will close this ticket.

There are three separate issues referenced in this ticket; I am associating this ticket with the array_merge() one. I suspect that the exception when $returned_entries is not set is already fixed with other work (prob ).

The tag clearing issue I need more detail on and think it warrants a separate issue; Noa and Gonen, please see my questions above and open a new ticket with details on what behaviour you're seeing (ideally including full steps to reproduce the issue).

Thanks all!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.