ColdTrick / event_manager

Manage events in Elgg
https://elgg.org/plugins/736695
27 stars 37 forks source link

Fatal Error on File Upload #172

Closed rohit1290 closed 2 years ago

rohit1290 commented 2 years ago

Elgg version 4.1.3

Plugin version v14.0

Plugin source Git clone (Yes, composer install is run)

Describe the bug Elgg is showing a fatal error after uploading a file in the event.

To Reproduce

  1. Create an event with normal details.
  2. Once the event is saved, you will get the option to upload the file image
  3. Upload a sample file
  4. Now view the event and there will be a fatal error.

Additional context Here's the error log:

ELGG.ERROR: ElggMenuItem::factory: $options "name" and "text" are required.  {"backtrace":[
"[#29] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/HandlersService.php:63",
"[#28] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/PluginHooksService.php:69",
"[#27] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/Menu/Service.php:92",
"[#26] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/Menu/Service.php:47",
"[#25] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/lib/views.php:499",
"[#24] /opt/lampp/htdocs/www/elgg4/mod/event_manager/views/default/event_manager/event/view/files.php:9",
"[#23] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/ViewsService.php:511",
"[#22] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/ViewsService.php:444",
"[#21] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/lib/views.php:210",
"[#20] /opt/lampp/htdocs/www/elgg4/mod/event_manager/views/default/event_manager/event/view.php:14",
"[#19] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/ViewsService.php:511",
"[#18] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/ViewsService.php:444",
"[#17] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/lib/views.php:210",
"[#16] /opt/lampp/htdocs/www/elgg4/mod/event_manager/views/default/object/event.php:15",
"[#15] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/ViewsService.php:511",
"[#14] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/ViewsService.php:444",
"[#13] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/lib/views.php:210",
"[#12] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/lib/views.php:601",
"[#11] /opt/lampp/htdocs/www/elgg4/mod/event_manager/views/default/resources/event/view.php:25",
"[#10] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/ViewsService.php:511",
"[#9] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/ViewsService.php:444",
"[#8] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/lib/views.php:365",
"[#7] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/Router.php:209",
"[#6] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/Router.php:120",
"[#5] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/Router.php:100",
"[#4] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/Application.php:417",
"[#3] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/Application.php:308",
"[#2] /opt/lampp/htdocs/www/elgg4/vendor/elgg/elgg/engine/classes/Elgg/Application.php:358",
"[#1] /opt/lampp/htdocs/www/elgg4/index.php:8"],
"process_id":17019,
"memory_peak_usage":"4 MB",
"memory_usage":"4 MB",
"url":"/www/elgg4/event/view/436/test",
"ip":"::1",
"http_method":"GET",
"server":"localhost",
"referrer":"http://localhost/www/elgg4/",
"unique_id":"YiMFJD8y2AycU1roTHwL7QAAAAo"},
referer: http://localhost/www/elgg4/
ELGG.CRITICAL: Exception at time 1646462246:\nCollection Elgg\\Collections\\Collection only accepts instances of ElggMenuItem
{"backtrace":[],
"process_id":17019,
"memory_peak_usage":"4 MB",
"memory_usage":"4 MB",
"url":"/www/elgg4/event/view/436/test",
"ip":"::1",
"http_method":"GET",
"server":"localhost",
"referrer":"http://localhost/www/elgg4/",
"unique_id":"YiMFJD8y2AycU1roTHwL7QAAAAo"},
referer: http://localhost/www/elgg4/
jdalsem commented 2 years ago

Fixed in https://github.com/ColdTrick/event_manager/commit/8ffd3138a591e5a46221c866693dffc1b2e260ca