Skip to main content

Questions tagged [jtable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
18 views

Joomla component detail view error: 404 Could not load the item

I have a table named edu2f_jobs_jobs. This table is received here: public function getTable($type = 'Job', $prefix = 'Administrator', $config = array()) { return parent::getTable($type, $prefix, $...
Jelle's user avatar
  • 1
0 votes
1 answer
34 views

Using a table from a library when namespaced

I'm using a library where i have some things like tables i use in different components i made. Until now i could do this in a component model to use a table from my library: class ItemModel extends ...
maidan's user avatar
  • 443
0 votes
0 answers
30 views

How to know about errors when using Table class store method without using getError

I'm wondering how to find errors when a table class is used, inheriting from \Joomla\CMS\Table and using the store method? It appears that in Table, the store method traps errors in a try-catch ...
mbrampton's user avatar
  • 314
1 vote
1 answer
500 views

J4. Table class in controller

I can't get Table class to work in a controller. I try to get the data of a record in a table but I always get 0 Call to a member function load() on bool Is it possible to use the Table class in a ...
Peli's user avatar
  • 103
1 vote
1 answer
180 views

I want to display a form with the data added already

public function getLaymanLayout($id){ $form = $this->getForm(); $form->bind(0); } I still have a lot to implement and make it correct to the MVC rules. I want to call a table from the ...
DeesreX's user avatar
  • 87
2 votes
0 answers
58 views

What to use: Table store vs. prepareTable

What is the reason a Joomla integrated component like contacts sets modified and modified_by while saving once in the prepareTable() method of the Model and also in the storeTable() method? Is this ...
maidan's user avatar
  • 443
1 vote
0 answers
65 views

Error: Table 's' was not locked with LOCK TABLES at $table->store()

I'm trying to load an existing table (not using primary key) and then storing it, but get this error: Error: Table 's' was not locked with LOCK TABLES: Unknown column 'alias' in 'field list' My code:...
Olle Härstedt's user avatar
0 votes
1 answer
56 views

JTable return associative array instead of object

I am using the JTable class, but I have an issue, at the moment I export the data I get from the table via this way: $table = $this->getTable('Articles'); $table->load($id); $properties = $...
Kuubs's user avatar
  • 345
1 vote
3 answers
339 views

Joomla 3.9 replace zero dates with null on save/checkin (mysql zero date deprecated)

So zero dates are deprecated in MySQL. J4 has replaced them with nulls.I am trying to update a J3 component to stop J setting zeros in the modified and checked_out_time fields. For modified I am using ...
RogerCO's user avatar
  • 81
1 vote
1 answer
426 views

JTable, new row doesn't get inserted with table->save method

I'm trying to insert a row with the table->save() method, but the method executes an UPDATE instead. There is no row available, so it needs to be inserted. Does anyone know how to get it inserted? ...
Kuubs's user avatar
  • 345
0 votes
1 answer
40 views

where is JTable defined?

For learning purpose, I am trying to read the definition of class JTable. But I couldn't find where this class is defined, although I see lots of reference to this class in some components' code, for ...
shenkwen's user avatar
  • 1,389
0 votes
1 answer
77 views

JTable :: has no code but does something

I read tutorial on Joomla.org about com development using database in the link https://docs.joomla.org/Special:MyLanguage/J3.2:Developing_an_MVC_Component/Using_the_database. on the file admin/tables/...
dhany saguntoro's user avatar
0 votes
0 answers
97 views

Set article attribs on-the-fly via JTable

I am using a CCK (Seblod) that extends com_content and allows adding complex fields, like PHP code to be run on onBeforeRender event. I need to change the values of some attribs of an article in the ...
Nene's user avatar
  • 1
1 vote
1 answer
134 views

Error saving an edit in a custom component `table_users` was not locked with LOCK TABLES

I'm getting an error when trying to save edits in my custom component. I have another edit.php that works well. I identified that the problem lies in the table file, specifically in the function ...
Thiago Guimarães's user avatar
0 votes
0 answers
23 views

Displaying label (boostrap badge) in an admin grid

I need to display a green highlighted message in my grid. I'm currently using <span class="label label-success">message</span> Is there any way to do it via code like JFactory::...
Thiago Guimarães's user avatar
1 vote
1 answer
79 views

Store category record using JTable instance from controller

I want to store a category record from controller by using JTable. My working code is- $table = JTable::getInstance('Category'); $data = array('id' => 0, 'parent_id' = 1, 'path' => 'demo', '...
Sajeeb Ahamed's user avatar
1 vote
1 answer
521 views

Save failed with the following error: Unknown column 'created' in 'field list'

As I develop the back end manage record functionality of a component, I am getting "Save failed with the following error: Unknown column 'created' in 'field list'" I built the helloworld component ...
IberoMedia's user avatar
1 vote
1 answer
1k views

Find user by email

How can I look up a user by email? I thought that JTable::load would do it, but it returns a weird data shape: $user = JTable::getInstance('User', 'JTable', array()); $user->load(array("email" =&...
steel's user avatar
  • 217
1 vote
1 answer
774 views

Joomla core table names for JTable::getInstance?

I'm building a tool to import content for various languages. It makes copies of existing items such as menus, articles, modules, etc. that have language specific content. For example, when copying an ...
Sloan Thrasher's user avatar
0 votes
1 answer
181 views

JTable->check() - Save failed with following reason: (with no reason)

In my component's JTable's subclass, I have overridden the check() method to perform my internal checks, when saving an item with my JModelAdmin subclass. So when saving an item, if any of those ...
FFrewin's user avatar
  • 19.7k
1 vote
0 answers
584 views

JModelAdmin - save() method. What's the purpose of $table->newTags?

Can someone explain me why in the save method of the AdminModel class, there is the creation of a new $newTags property on the $table? How this new property is used? How is it handled later on by the ...
FFrewin's user avatar
  • 19.7k
1 vote
1 answer
77 views

Invalid parent id

We get "Invalid parent id" when saving our custom JTable ($ourTable->store(); $ourTable->getErrors();). We didn't have this problem before 3.7.3. Is this commit related? https://github.com/...
Olle Härstedt's user avatar
0 votes
1 answer
656 views

Programmatically update Menu Item in Component

Im creating a component, where among other things, can create and update menus, and i have successfully used this answer to create a new menu item. Programmatically Add Menu Item in Component $...
bymem's user avatar
  • 1
5 votes
1 answer
554 views

Why does Joomla have both models and tables?

In classic MVC, you have models that loosely corresponds to the underlying database tables. Why would Joomla need both models and tables? Edit Some quotes from provided links: In summary, the model ...
Olle Härstedt's user avatar
1 vote
1 answer
76 views

storing id using JTables

I am trying to insert the id value using JTable, however it seems like I have missed something and made the mistake while doing so. What changes do I need to make so as to get this working? Thanks in ...
Nikita Dhiman's user avatar
2 votes
1 answer
98 views

Strange behavior with dates

I would like to store the input of the calendar-field in my JTable::store. To do so I'm doing this: Form-declaration: <field name="creationdate" type="calendar" default=...
MyFault's user avatar
  • 677
1 vote
1 answer
851 views

Use JTable to save frontend-data

I would like to save user-inputs (Form with multiple text-fields) from the frontend of my component using (admin-) JTable. In this case I would like to save a new comment to the database. I guess I ...
MyFault's user avatar
  • 677
2 votes
1 answer
307 views

How to use look-up tables in a custom component?

I'm trying to develop my first component in Joomla 3.x. I'm new to the MVC paradigm and learning the basics of Joomla development. To start, I'm trying to develop a simple component to add and ...
nimble's user avatar
  • 418
0 votes
2 answers
104 views

After upgrade to 3.5: return $row->id (last saved item) does not work

I would like to get the ID of an item that I recently saved using store-method. On Joomla 3.4.48 I was able to use this source: $data['userid'] = $userid; $data['title'] = $title; $...
MyFault's user avatar
  • 677
3 votes
1 answer
98 views

Why is there no rebuild() function call after deleting a usergroup?

Examining the class JTableUsergroup located in libraries\joomla\table\usergroup.php I found out, that the nested set is rebuilt after storing a new usergroup but not after deleting one. Is this ...
Mario Neubauer's user avatar
1 vote
1 answer
95 views

Save JINPUT to JTable via CLI AND web-backend

I'm using a helper which is called by an Joomla-CLI-Script. In this script I would like to add items to my database using JTable::store. In the storing-process I'm checking some JINPUT-values, that ...
MyFault's user avatar
  • 677
1 vote
1 answer
504 views

Question about JTable::getInstance in libraries/joomla/table/table.php file

I was trying to read and understand some joomla core PHP code when I came across this function. It is located in libraries/joomla/table/table.php line 268. At the end of the function in line 305, it ...
shenkwen's user avatar
  • 1,389
3 votes
1 answer
119 views

Joomla: How to insert $jinput to JTable::store via CLI?

I got a little problem: I would like to create a form, which content is saved into 2 databases. Field1 -> #__table_1 Field2 -> #__table_2 I'm doing this by extending the save-method in my ...
MyFault's user avatar
  • 677
2 votes
2 answers
424 views

Using tags: JTable::store() returns false

I'm using tags in my components. Hm, well - I would like to use them ;-) This is my form-declaration for tags: <field name = "tags" type = "tag" ...
MyFault's user avatar
  • 677
5 votes
1 answer
146 views

Where is class $tableClass defined?

I have very little knowledge about joomla core and PHP. In order to better handle my website, I am trying to read a small part of joomla core, when I come across this function JTable:getInstance, (...
shenkwen's user avatar
  • 1,389
1 vote
2 answers
724 views

Load from JTable with some null values

I'm trying to load a specific row from my database table with JTable. In my case i have 3 fields which is unique. In most cases, two of these fields will be a null value, while one will always have a ...
Morten's user avatar
  • 111
1 vote
1 answer
375 views

Delete items of database via CLI

I would like to delete some items with state "trashed" via CLI. Is it possible to call the delete-method of JTable from CLI? Thanks for your help :-)
MyFault's user avatar
  • 677
1 vote
3 answers
2k views

How to get the generated id after a successful INSERT query?

I would like to get the id of the last saved dataset in a JTable-Operation. At the moment I got this: // Create and populate an object. $value = new stdClass(); $value->userid = (int)$...
MyFault's user avatar
  • 677
3 votes
2 answers
489 views

A foreign key field not updating as NULL

I am having a field 'leavepack_id' in a table with the below table definition CREATE TABLE IF NOT EXISTS `#__position` ( `position_id` int(11) NOT NULL AUTO_INCREMENT, `leavepack_id` int(9) ...
Malaiselvan's user avatar
  • 2,731
0 votes
3 answers
1k views

Store data to other table and get the id

I'm using a method to store information in another table. This is how I'm doing that: public static function CreateMail($userid, $title, $state = 1) { $maildata['userid'] = $userid; ...
MyFault's user avatar
  • 677
2 votes
1 answer
95 views

Working with Entities and Repositories in Joomla

If some of you use Symfony2, you should see what I'm referring to: The entity is basically an object as persisted in the database, and the repository is a class implementing methods to get it, or all, ...
Khaarkh's user avatar
  • 375
1 vote
1 answer
490 views

JTable - Access properties that does not belongs to the specified table

Suppose, I've two tables with following column: #__table1 - id, col1, col2 #__table2 - id, col3, col4 I've created JTable class in tables folder of my component: class ComponentNameTableTable1 ...
Sahil Purav's user avatar
  • 1,302
2 votes
1 answer
182 views

JTable - How to know which fields are getting updated

I'm creating custom helpdesk ticketing component, where I need to track user activities. For e.g., If user have created the ticket, then it should get save to history table. Let's say user wants to ...
Sahil Purav's user avatar
  • 1,302
0 votes
1 answer
180 views

Joomla Form - Retrieve Values based on ID (Front End)

I'm using jform and joomla's core features of dealing with forms. i.e. Using XML as forms then storing it with JTable etc. My custom component has to deal with CRUD operation strictly at front-end. ...
Sahil Purav's user avatar
  • 1,302
1 vote
3 answers
714 views

JTable - Overriding store() method

I'm overriding store method to add "created" and "created_by" column in database. modified column is getting inserted with current date properly. But, for a new request, created and created_by columns ...
Sahil Purav's user avatar
  • 1,302
0 votes
0 answers
826 views

Create forms in Joomla custom html module for multiple tables

I would like to add a form that takes input for two tables. One table with single row insert to 1st table, and the other one, with multiple rows insert to 2nd table at the same time. I have read ...
Srinath Naidu's user avatar
3 votes
2 answers
803 views

JTable store() returns true but no row gets inserted

Here is the class definition class MyTable extends JTable{ public $parent_id = null; public $hits = 1; function __construct() { parent::__construct('#__mytable', 'parent_id',...
dsat's user avatar
  • 41
3 votes
2 answers
3k views

What does JTable's bind function do and why it is useful?

When writing a view which either edits creates a record, the model extends admin model which requires getTable() and getForm(). Now the confusion is how the loadForm() function knows the number of ...
Sumer Raj Chouhan's user avatar
0 votes
0 answers
136 views

Component JTable ignores setDbo() and don't save row

I have component called "MyComponent" and table class called "MyComponentTableSample". In model I create instance to table: $table = JTable::getInstance('Sample', 'MyComponentTable'); then I want to ...
turson's user avatar
  • 570