Inline edit plug-in deleting records from database

ginniss

Member
Hi

I have implemented the inline edit plugin on a list (contracts) containing a left join to another list (expenses).

I have limited the plugin to one element (status), which belongs to the left join list (expenses).

The pop-up appears, as expected, when the status element is clicked on. And, I am able to change the value of status in the drop-down list. However, if the new value is saved the entire row in the expenses list, associated with the status element, is deleted/"disappears" from the database.

FYI, I have implemented the plugin directly on the expense list and it works without problems.
 
After disabling the inline plugin, I have noticed that updating a record from the list view sometimes results in other records being deleted.

I can find no pattern to this behaviour. Any ideas on troubleshooting?
 
Can you post your contracts list join settings?
The join in Fabrik needs one "leg" to be the primary key (contracts.primary-key = expenses.foreign-key or contracts.FK = expenses.PK)
 
Hi Troester

There is a single join between contract and expenses:

Join Type: Left
From: contract_summary
To: invoice_header
From Column: Id // primary key
To Column: Contract_id //foreign key
Repeatable: No
 

Attachments

  • 2014-04-30 09:22:58 +00001.png
    2014-04-30 09:22:58 +00001.png
    61.7 KB · Views: 425
Hi Troester

Many thanks for your reply.

The problem I am experiencing with records being deleted from pre-filtered lists is indeed the same as the thread started last Friday.

I have seen Hugh's reply this morning, and find it hard to believe that only a couple of people are experiencing this issue.

Without a solution, or even a work-around, I am staring at the prospect of several weeks work down the drain and starting development again without Fabrik.

I started this tread 6 weeks ago and have only just, indirectly received a response.

It would be appreciated if I could have a dialogue with somebody in the development team to see if I can find a viable work-around.
 
After disabling the inline plugin, I have noticed that updating a record from the list view sometimes results in other records being deleted.


How are you doing the updating at this point? Do you mean editing the row (so going to form view) and saving it?

-- hugh
 
Hi Hugh

Yes, I am referring to row editing of a joined list ("contracts " and "expenses") - see previous post for details of the join. The problem of deleted records occurs irrespective of whether I use the inline editor plugin, update column plugin or the standard row edit feature (form view).

I am using pre-filters on the joined list to show: 1) only expense records for a logged in user's company; and, 2) only expenses of a specific status.

If, for example, I try to edit the "status" element of a specific row and save the new value, one of three things happens: 1) the status is updated OK and the row is not deleted from the database; 2) the edited row is deleted from the database on saving; 3) the edited row and and several other unedited rows are deleted from the database. So far, I have been unable to identify a pattern for this behaviour.
 
Removing the filters seems to have made the problem worse.

With filters, records were being deleted intermittently.

Without filters, all records related to a particular contract, except the row that is edited and saved, are deleted.
 
I'm going to have to get Rob involved in this one. It's above my pay grade, and involves both some fairly gnarly code, and design issues that could have unintended consequences.

Sorry about these issues, we thought we had all this sorted out in 3.1, but obviously not.

I've raised an urgent issue in github for Rob to take a look. Can you make sure that all your My Sites information is correct and up to date, as he'll no doubt need ftp and phpMyAdmin access, as well as normal site access.

https://github.com/Fabrik/fabrik/issues/1254

-- hugh
 
Hugh

Many thanks for looking at this. My MySites info is complete and up-to-date

Hopefully Rob can find a solution.
 
hi I took a look at the site but didnt see the list with the joins and inline edit plugin installed - has it been removed?
 
Hi Rob

Thanks for following up.

I did indeed disable the inline plugin whilst troubleshooting. But, I found the problem still occurs without it (please see reply #2 above). I have re-enabled it for one of the lists, called "Open Transactions".

Record self deleting has occurred on the following lists:

- Company Details (newtrading_party DB) - front end menu option "Company Details"
- Company Users (company_users DB) - front end menu option "User Details"
- Contact Overview (contract_summary DB) - front end menu option "Contracts"
- Open Transactions (contract_summary DB) - front end menu option "Open Transactions"
- Trading History (contract_summary DB) - front end menu option "Trading History"

The relationship between these tables is as follows:

Companies (Company Details) register on the website. Website users (Company Users) are set up, linked to a company.
Companies set up agreements (Contract Overview), to which their transactions (Open Transactions / Trading History) are linked.

I have removed the pre-filters on the above lists to aid troubleshooting, but the intention is:

1) That User access is limited to the data related to their company;
2) That transactions appear in either the "Open Transactions" or "Trading History" list, depending on status. E.g. transactions awaiting approval first appear in the "Open Transactions" list, and are moved to the "Trading History" list after approval takes place.
 
Rob has been super busy working on the new JED project, and I've been going through some medical issues (spine surgery). I'll remind Rob about this one as soon as he comes back online.

-- hugh
 
Hugh

Many thanks for the update. Anything that can be done to expedite things would be appreciated. I'm stuck with this development until it is solved.

Best wishes for a speedy recovery from your surgery.

Glenn
 
hi
Sorry for the late reply here; this feel off my radar.
I believe I have fixed this issue with this commit https://github.com/Fabrik/fabrik/commit/ae5b456223026b140c88ecb860698521be54895c

The main issue is that in your data model you had a one to many data structure, eg one agreement has many transactions, but the join was not set to repeat.

Thus, Fabrik infers that one agreement should have one transaction. So when you save the agreement, Fabrik removs all the related transactions. We do that as IF the join was set to repeat then the user can remove records in the form, and we need to update the database to reflect those deletions.

However, if the join is not repeating then this deletion should not occur as the user could never have deleted a transaction from the form to start with. So the commit addresses that issue. It also addresses an issue where by any transaction that might be hidden from the user via a prefilter would also have been deleted, regardless of the joins repeat setting.

I do think though that the join should be set to repeat on your site, as to show in the form/details all transactions for any agreement

You should be update from github to apply the fix

-Rob
 
Hi Rob

I have set the join for the "Agreement" list to repeat and applied the github updates.

The problem of deleted records seems to be solved. However, I now have a new problem, namely: in list view a record shows, for example, an invoice number of GEN0004; clicking on "edit" or "view" for this record links to a different record in form view, e.g. invoice GEN0002 instead of GEN0004.

Is this related to the github updates?

Glenn
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top