Questions tagged [jtable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
28 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 = $...
1
vote
1answer
32 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 ...
1
vote
1answer
69 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? ...
0
votes
1answer
28 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 ...
0
votes
1answer
42 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/...
0
votes
0answers
81 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 ...
1
vote
1answer
77 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 ...
0
votes
0answers
18 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::...
1
vote
1answer
50 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', '...
1
vote
1answer
398 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 ...
1
vote
1answer
921 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" =&...
1
vote
1answer
516 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 ...
0
votes
1answer
165 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 ...
1
vote
0answers
550 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 ...
1
vote
1answer
76 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/...
0
votes
1answer
581 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 $...
5
votes
1answer
492 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 ...
1
vote
1answer
70 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 ...
2
votes
1answer
83 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=...
1
vote
1answer
791 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 ...
2
votes
1answer
280 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 ...
0
votes
2answers
97 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; $...
3
votes
1answer
93 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 ...
1
vote
1answer
87 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 ...
1
vote
1answer
452 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 ...
3
votes
1answer
118 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 ...
2
votes
2answers
404 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" ...
5
votes
1answer
142 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, (...
1
vote
2answers
645 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 ...
1
vote
1answer
358 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 :-)
1
vote
3answers
1k 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)$...
3
votes
2answers
444 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) ...
0
votes
3answers
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; ...
2
votes
1answer
87 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, ...
1
vote
1answer
487 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 ...
2
votes
1answer
174 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 ...
0
votes
1answer
171 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. ...
1
vote
3answers
675 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 ...
0
votes
0answers
803 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 ...
3
votes
2answers
748 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',...
3
votes
2answers
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 ...
0
votes
0answers
133 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 ...