techjoomla / com_api

API framework for Joomla
http://docs.techjoomla.com/joomla-rest-api/com-api-introduction
GNU General Public License v3.0
123 stars 97 forks source link

Error when trying to add an API key in administrator (joomla 3.6.0) #28

Closed alexgarel closed 7 years ago

alexgarel commented 8 years ago

On joomla 3.6.0

As I go in administrato com api / keys. If I try to create a new get I get this error (I'm on a test instance in debug mode)

Notice: Undefined property: JObject::$ordering in /home/ubuntu/com_api/code/admin/views/key/tmpl/edit.php on line 84 
Call Stack #TimeMemoryFunctionLocation 
10.0000239120{main}( )../index.php:0 
20.01281954472JApplicationCms->execute( )../index.php:51 
30.01281954776JApplicationAdministrator->doExecute( )../cms.php:257 
40.18985947272JApplicationAdministrator->dispatch( )../administrator.php:152 
50.18995948608JComponentHelper::renderComponent( )../administrator.php:98 
60.19095976344JComponentHelper::executeComponent( )../helper.php:380 
70.19106001400require_once( '/home/ubuntu/com_api/code/admin/api.php' )../helper.php:405 
80.19476156904JControllerLegacy->execute( )../api.php:28 
90.19476157120ApiController->display( )../legacy.php:728 100.19496171448JControllerLegacy->display( )../controller.php:30 
110.19686359840ApiViewKey->display( )../legacy.php:690 
120.21136815848JViewLegacy->display( )../view.html.php:54 130.21136816360JViewLegacy->loadTemplate( )../legacy.php:209 
140.21166861720include( '/home/ubuntu/com_api/code/admin/views/key/tmpl/edit.php' )../legacy.php:670 " /> 

The problems comes from a hidden field calling item->ordering which does not seems to exists.

<input type="hidden" name="jform[ordering]" value="<?php echo $this->item->ordering; ?>" />

Commenting this line, makes it work.

alexgarel commented 8 years ago

I've looked quickly but I don't understand why this ordering is here. I see no ordering column in table…

coolbung commented 8 years ago

This table does not need ordering, so the column isnt there. Would you be able to send a pull request that removes the traces of ordering in the code ?

alexgarel commented 8 years ago

Cf. #30