Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Finally I found the answer after deep googling. Thanks to <strong>Hirnhamster</strong> the user, <a href="http://forums.recessframework.org/" rel="nofollow">http://forums.recessframework.org/</a>.</p> <p><strong>Solution</strong></p> <p>The solution is - in contrast to finding the real problem - rather easy:</p> <p><strong>1. Step:</strong></p> <p>Open the file DefaultPolicy.class.php in recess/recess/framework. Go to method preprocess(..). Add the line $this->reparameterizeForFormat($request); as last command before returning. The function should now look like this:</p> <pre><code>&lt;?php public function preprocess(Request &amp;$request) { $this-&gt;getHttpMethodFromPost($request); $this-&gt;forceFormatFromResourceString($request); $this-&gt;reparameterizeForFormat($request); return $request; } ?&gt; </code></pre> <p><strong>2. Step</strong></p> <p>In the same file, go to method forceFormatFromResourceString(...). Change the line $format = substr($lastPart, $lastDotPosition + 1); to $format = strtolower(substr($lastPart, $lastDotPosition + 1)); Add the line $request->format = $format; below if($format !== '') { The function should now look like this:</p> <pre><code>&lt;?php protected function forceFormatFromResourceString(Request &amp;$request) { $lastPartIndex = count($request-&gt;resourceParts) - 1; if($lastPartIndex &lt; 0) return $request; $lastPart = $request-&gt;resourceParts[$lastPartIndex]; $lastDotPosition = strrpos($lastPart, Library::dotSeparator); if($lastDotPosition !== false) { $format = strtolower(substr($lastPart, $lastDotPosition + 1)); if($format !== '') { $request-&gt;format = $format; $mime = MimeTypes::preferredMimeTypeFor($format); if($mime !== false) { $request-&gt;accepts-&gt;forceFormat($format); $request-&gt;setResource(substr($request-&gt;resource, 0, strrpos($request-&gt;resource, Library::dotSeparator))); } } } return $request; } ?&gt; </code></pre> <p><strong>3. Step</strong></p> <p>In the same file, go to method reparameterizeForFormat(...). (Be astonished that this function already exists :P). Change Format::JSON to "json" and Format::XML to "xml" The function should now look like this:</p> <pre><code>&lt;?php protected function reparameterizeForFormat(Request &amp;$request) { if($request-&gt;format == "json") { $method = strtolower($request-&gt;method); $request-&gt;$method = json_decode($request-&gt;input, true); } else if ($request-&gt;format == "xml") { // TODO: XML reparameterization in request transformer } return $request; } ?&gt; </code></pre> <p><strong>4. Step</strong></p> <p>You are done.</p> <p><strong>For Detailed Solution</strong>:</p> <p><a href="http://webcache.googleusercontent.com/search?q=cache%3ahttp://forums.recessframework.org/topic/189-json-request-doesnt-insert-values-in-v02/" rel="nofollow">http://webcache.googleusercontent.com/search?q=cache:http://forums.recessframework.org/topic/189-json-request-doesnt-insert-values-in-v02/</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload