Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Rest Delete throwing array_merge() error?
  • Hi- I've recently run into an issue within my REST-ful controllers. 

    PHP version: 7.4.*
    Fuel Version: 1.8.*

    Typically, my controllers are setup like this:
    <br>
    class Controller_Mycontroller extends Controller_Rest {
    <br>
    ...
    <br>
    <span style="white-space:pre"> </span>public function delete_delete($id) {
    <span style="white-space:pre"> </span>
    <span style="white-space:pre"> </span>...
    <span style="white-space:pre"> </span>$ormObject = Model_Something::find($id);
    <span style="white-space:pre"> </span>$ormObject-&gt;delete();
    <br>
    <span style="white-space:pre"> </span>return;
    <span style="white-space:pre"> </span>}
    <br>
    }
    <br>

    This results in 500 errors with the following message:






    Warning!


    ErrorException [ Warning ]: array_merge(): Expected parameter 5 to be an array, string given


    COREPATH/classes/input/instance.php @ line 302:


    301:	{
    <strong>302: return array_merge($this-&gt;input_get, $this-&gt;input_post, $this-&gt;input_put, $this-&gt;input_patch, $this-&gt;input_delete);</strong>
    303: }



    This is only happens on my DELETE calls (from the app), and not on POST, GET, or PUT.

    Any ideas?
  • I'll have a look.
  • HarroHarro
    Accepted Answer
    You might want to upgrade to 1.9-dev, it looks like this is already adressed.

    I'll try to create a 1.8.3 release soon with the latest fixes.
  • Thank you, I'll give that a shot

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion