Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent "Parameter must be scalar" error when creating a calendar event #2

Closed
wants to merge 1 commit into from
Closed

Prevent "Parameter must be scalar" error when creating a calendar event #2

wants to merge 1 commit into from

Conversation

sbourget
Copy link

In version 16.1.20160715 when a user creates a calendar event, it fails with the following error in the apache logs (Apache 2.4.23, PHP 7.0.8):

An error happened (EGroupware\Api\Exception\WrongParameter): calendar_bo::resource_info(NULL) parameter must be scalar, referer: https://egroupware.XXXX.org/index.php?menuaction=calendar.calendar_uiforms.edit&date=20160719&hour=7&minute=30&owner[]=11
#0 C:\Web\sites\egroupware\calendar\inc\class.calendar_uiforms.inc.php(422): calendar_bo->resource_info(NULL), referer: https://egroupware.XXXX.org/index.php?menuaction=calendar.calendar_uiforms.edit&date=20160719&hour=7&minute=30&owner[]=11
#1 C:\Web\sites\egroupware\api\src\loader\deprecated_factory.php(191): calendar_uiforms->process_edit(Array), referer: https://egroupware.XXXX.org/index.php?menuaction=calendar.calendar_uiforms.edit&date=20160719&hour=7&minute=30&owner[]=11
#2 C:\Web\sites\egroupware\api\src\Etemplate.php(366): ExecMethod(Array, Array), referer: https://egroupware.XXXX.org/index.php?menuaction=calendar.calendar_uiforms.edit&date=20160719&hour=7&minute=30&owner[]=11
#3 [internal function]: EGroupware\Api\Etemplate::ajax_process_content('calendar_egroup...', Array, ''), referer: https://egroupware.sau19.org/index.php?menuaction=calendar.calendar_uiforms.edit&date=20160719&hour=7&minute=30&owner[]=11
C:\Web\sites\egroupware\api\src\Json\Request.php(179): call_user_func_array(Array, Array), referer: https://egroupware.XXXX.org/index.php?menuaction=calendar.calendar_uiforms.edit&date=20160719&hour=7&minute=30&owner[]=11
#5 C:\Web\sites\egroupware\api\src\Json\Request.php(91): EGroupware\Api\Json\Request->handleRequest('EGroupware\Api\...', Array), referer: https://egroupware.XXXX.org/index.php?menuaction=calendar.calendar_uiforms.edit&date=20160719&hour=7&minute=30&owner[]=11
#6 C:\Web\sites\egroupware\json.php(119): EGroupware\Api\Json\Request->parseRequest('EGroupware\Api\...', '{"request":{"pa...'), referer: https://egroupware.XXXX.org/index.php?menuaction=calendar.calendar_uiforms.edit&date=20160719&hour=7&minute=30&owner[]=11
#7 {main}, referer: https://egroupware.XXXX.org/index.php?menuaction=calendar.calendar_uiforms.edit&date=20160719&hour=7&minute=30&owner[]=11

Instance=default, User=egroupware, Request=POST https://egroupware.XXXX.org/json.php?menuaction=EGroupware\\Api\\Etemplate::ajax_process_content, User-agent=Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0, referer: https://egroupware.XXXX.org/index.php?menuaction=calendar.calendar_uiforms.edit&date=20160719&hour=7&minute=30&owner[]=11

This occurs because the $participant has a value of null during one of the iterations of the foreach loop. This patch simply checks to see if there is a value before executing the code within the loop.

@ralfbecker
Copy link
Member

@nathangray Can you have a look at that pull request.

Ralf

@nathangray
Copy link
Contributor

Is there any difference between wrapping that whole thing in an if as compared to something like if(is_null($participant)) continue;?

@ralfbecker
Copy link
Member

No, does the same thing and does not indent the whole thing further.

@nathangray Please go ahead, implement that and close the PR.

@nathangray
Copy link
Contributor

Implemented, thanks @sbourget

@nathangray nathangray closed this Jul 25, 2016
Lankaster added a commit to Lankaster/egroupware that referenced this pull request Jan 4, 2019
Error examples:
[Thu Jan 03 13:11:34.043522 2019] [:error] [pid 18181] [client 192.168.1.100:38306] PHP Warning: array_intersect(): Argument EGroupware#2 is not an array in /usr/share/egroupware/calendar/inc/class.calendar_groupdav.inc.php on line 818, referer: http://egroupware/egroupware/groupdav.php/ABC/calendar/
[Thu Jan 03 13:59:41.125066 2019] [:error] [pid 18364] [client 192.168.1.100:40350] PHP Warning: Invalid argument supplied for foreach() in /usr/share/egroupware/api/src/Etemplate/Widget/Nextmatch.php on line 314, referer: http://egroupware/egroupware/index.php?cd=yes
@Lankaster Lankaster mentioned this pull request Jan 4, 2019
ralfbecker added a commit that referenced this pull request Apr 7, 2021
ralfbecker added a commit that referenced this pull request Sep 24, 2021
ralfbecker added a commit that referenced this pull request Sep 24, 2021
ralfbecker added a commit that referenced this pull request Oct 4, 2021
ralfbecker added a commit that referenced this pull request Oct 4, 2021
ralfbecker added a commit that referenced this pull request Oct 7, 2021
…f type array, null given" when creating a category
ralfbecker added a commit that referenced this pull request Oct 7, 2021
…f type array, null given" when creating a category
nathangray added a commit that referenced this pull request Oct 13, 2021
nathangray added a commit that referenced this pull request Oct 14, 2021
nathangray added a commit that referenced this pull request Oct 14, 2021
nathangray added a commit that referenced this pull request Oct 14, 2021
nathangray added a commit that referenced this pull request Oct 22, 2021
nathangray added a commit that referenced this pull request Oct 22, 2021
ralfbecker added a commit that referenced this pull request Jan 25, 2023
ralfbecker added a commit that referenced this pull request Apr 27, 2023
ralfbecker added a commit that referenced this pull request Apr 27, 2023
ralfbecker added a commit that referenced this pull request Jun 7, 2023
ralfbecker added a commit that referenced this pull request Jun 7, 2023
nathangray pushed a commit that referenced this pull request Aug 22, 2023
nathangray added a commit that referenced this pull request Oct 11, 2023
calendar_uiforms::event_changed(): Argument #2 ($_old) must be of type
array, bool given, called in
/var/www/epl-23.1/calendar/inc/class.calendar_uiforms.inc.php on line 2295
nathangray added a commit that referenced this pull request Oct 12, 2023
calendar_uiforms::event_changed(): Argument #2 ($_old) must be of type
array, bool given, called in
/var/www/epl-23.1/calendar/inc/class.calendar_uiforms.inc.php on line 2295
nathangray added a commit that referenced this pull request Oct 16, 2023
…tation

calendar_uiforms::event_changed(): Argument #2 ($_old) must be of type
array, bool given, called in
/var/www/epl-23.1/calendar/inc/class.calendar_uiforms.inc.php on line 2295
nathangray added a commit that referenced this pull request Oct 16, 2023
…tation

calendar_uiforms::event_changed(): Argument #2 ($_old) must be of type
array, bool given, called in
/var/www/epl-23.1/calendar/inc/class.calendar_uiforms.inc.php on line 2295
ralfbecker added a commit that referenced this pull request Oct 30, 2023
ralfbecker added a commit that referenced this pull request Oct 30, 2023
ralfbecker added a commit that referenced this pull request Sep 11, 2024
…when trying to create a new iCal Import profile for Infolog
ralfbecker added a commit that referenced this pull request Sep 11, 2024
…when trying to create a new iCal Import profile for Infolog
ralfbecker added a commit that referenced this pull request Nov 6, 2024
ralfbecker added a commit that referenced this pull request Nov 6, 2024
ralfbecker added a commit that referenced this pull request Nov 29, 2024
ralfbecker added a commit that referenced this pull request Nov 29, 2024
ralfbecker added a commit that referenced this pull request Dec 4, 2024
ralfbecker added a commit that referenced this pull request Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants