aaronpk / Aperture

Aperture is a Microsub server. Currently in beta.
https://aperture.p3k.io
Apache License 2.0
70 stars 5 forks source link

Mark as Read query not working with single entry[] #24

Closed EdwardHinkle closed 6 years ago

EdwardHinkle commented 6 years ago

You seemed to think that in a mark as read query, a single entry[] item should work. However, it doesn't seem to work with Aperture currently. Below is my post string:

action=timeline&channel=f9j5PuPeFZgSsekVAwcWr02J7zQRURC0&method=mark_read&entry[]=10862

My response was a 500 error and the following error:

ErrorException: Undefined variable: entryIds in file ~/aperture/app/Http/Controllers/MicrosubController.php on line 445

I'm thinking it's missing the "else" statement below:

if(!is_array(Request::input('entry'))) {
    $entryIds = [Request::input('entry')];
}

$result = $channel->mark_entries_read($entryIds);

Seems like it needs the following between those two lines?

else {
    $entryIds = Request::input('entry');
}
aaronpk commented 6 years ago

oops you're right! that fix looks like it should work