Strange Linked List new issue after 3.063.376

Status
Not open for further replies.
Hi there,
I have been battling some problems( some of my own ignorance ) and manage to sort them out.

I have managed to navigate from my Tender Register to the Tender_invitees now and even my File Upload error was resolved after the 3.063.368 bug

My key field is Tender_id and yesterday it was a database join field and the field was populated and save correctly keeping the link/

After going to 376 my FileUpload error is fixed but now , even though the tender_id field is seems to be correctly pre-populated on the form, it does not get saved to the table when submitting? It then loses the link and I have an orphan in the tender_invitation table.

I then changed the element type to Field/Integer and then it works! The tender_id is pre-populated as above, and it saves when submitting.

Although it works I wanted to uses a different tender_id label from the joined field to manage the creation of subfolders in the Fileupload field.

I know I can now create a joined table view that sort of does the same but ideally I need to go back the databasejoin functionaility that was working yesterday
 
Hi,

This has now resurfaced as now I really need the databasejoin as I have linked fields that I need to use to get the fileupload target folders to be more dynamic ...

I have upgraded to .416 and checked before resurrected/moving the issue to the top again ... can one of the developers please assist?
 
I thought it may have something to do with the fact that the link I send it to does not filter like it used to and I had to add a Pre-Filter
tender_id
EQUALS
{tender_invitees___tender_id}

to get it to only show the invitations related to this tender. When I remove the pre-filter it shows ALL the invitations which makes me think that THAT is actually the root cause.

The key does not get used in the filter as it should and it also does not save to the table as it should....
 
Hi Hugh,

This issue is now worse for me.

You indicated on the 14th November that you may have broken it
http://fabrikar.com/forums/showthread.php?t=29800

Hmmm, the way you had it first time should have worked. i'll have to do some testing, see if we've somehow managed to break query string filters.

-- hugh

It has affected me even more now as I realised it does not save added records although the filter value IS defaulted into the form
the related thread is below
http://fabrikar.com/forums/showthread.php?t=29698

It has now been 6 days and and I am moving forward, can you please find it in your heart to check what the issue is?


I have given you access to my site if it will help.

I have sent you a PM with the login details I am copying the other content in here if one of the other main developers are maybe looking at this

1. Click 3rd Menu item "Invite Vendors to Tender"
2. You will then see 3 tenders.
3. Pick say Tender 1 and and click edit button "Invite Vendors"
4. You will now see that although the filter shows tender_id = 1 the list displays all the invitations for all tenders ( I removed the pre-filter that you said should not have been necessary
5. If you now add an invitation (remember that we selected tender 1) you will see that the tender_id field is pre-populated as expected and select System Vendor ID "Supplier 1", .
6. When you submit that invitation you will see that the tender_id which is the "link" to the parent where we came from is not saved and the invitation is now orphaned

You will notice that the elements in the groups in the forms are still a bit over the place but I tidy up, get a problem, remove the join and then my field definitions are back to square one. I will have to wait until this issue is resolved now before I can even try and finalise this

Henry
 
My access to your site is not longer working.
But I can replicate something which may be similar to your issue:

I have a list (joio_test, ID=18) with a dbjoin element j_liste (normal dropdown, no multiselect), no prefilter in list or menu.
This list contains 4 records with j_list=8 (verified in phpMyAdmin and displayed correctly if displaying the list via menu item

Calling the list with URL
index.php?option=com_fabrik&view=list&listid=18&join_test___j_liste_raw=8&resetfilters=1&fabrikdebug=1
gives "no data"
WHERE ( `join_test`.`j_liste` REGEXP LOWER('"[[:<:]]8[[:>:]]"') )

It's inserting the right label into the filter box (no difference if element filter is set to field or dropdown), filtering on this element shows the same strange query.

So there seems something has happened with the filtering.
 
You indicated on the 14th November that you may have broken it
http://fabrikar.com/forums/showthread.php?t=29800
I fixed an issue (explained in that thread) that might have been a reason for that

If you could send me the pm as well that would be great, that way I can see what this thread is referring to, to be honest at the moment Im not actualy sure what the set up is, but if I see the site I'm hoping it will make more sense

-Rob
 
@troester

Calling the list with URL
index.php?option=com_fabrik&view=list&listid=18&jo in_test___j_liste_raw=8&resetfilters=1&fabrikdebug =1
gives "no data"
WHERE ( `join_test`.`j_liste` REGEXP LOWER('"[[:<:]]8[[:>:]]"') )
I can't replicate this now, although my recent changes *might* effect that. Is it still an issue for you with todays github code
 
Sorry, I was in a couple of meetings but I will quickly upgrade and check.

Rob, I will add you as a user and re-activate Troester
 
Hi Rob,

I PM'd you with the login and site details

I left my gmail as well as I will be on the road shortly but will try and monitor on my ipad

(this is a lot like watching out for Grandpa's visit, standing at the gate watching out for their car, not blinking just in case I miss them)
 
Troester, I PM's you as well. Reactivated and sent you new password

I just realised not only does it create an orphaned child tender_invitee record it also creates a "matching" tenders_register record in an attempt to retain the parent child link
 
1. Click 3rd Menu item "Invite Vendors to Tender"
2. You will then see 3 tenders.
3. Pick say Tender 1 and and click edit button "Invite Vendors"
Yes i see this .... but then.....
4. You will now see that although the filter shows tender_id = 1 the list displays all the invitations for all tenders ( I removed the pre-filter that you said should not have been necessary
For me I see the correctly filtered list

5. If you now add an invitation (remember that we selected tender 1) you will see that the tender_id field is pre-populated as expected and select System Vendor ID "Supplier 1", .
6. When you submit that invitation you will see that the tender_id which is the "link" to the parent where we came from is not saved and the invitation is now orphaned
I might fully understand what you want to achieve here, but my take on the issue is this.....

The reason why this is behaving as it is, is that in this form 'proc_tender_invitatations' its list is joined back to the 'Invite Vendors to Tender' table.

So yes whilst the 'tender_invitees___tender_id' field is populated with the value contained in the querystring, you are in addition creating a new record in the 'Invite Vendors to Tender' table. As this is a new record - its gets assigned a new primary key value.

Can I confirm that this is the basic model that you want to build:

There are a series of tenders and each tender can have 0 or 1 or many tender_invitations

If so then the basics of your two database tables would be:

--------------------
table name: tenders
--------------------
id (primary key)
other fields.....
---------------------


--------------------
table name: tender_invitations
----------------------
id (primary key)
tender_id (foreign key)
other fields.....
--------------------

In Fabrik I don't think you should be joining tender_invitations back to tenders. That relationship would be sufficiently described by the tender_invitations.tender_id element.

So my suggestion would be to edit the list tender_invitations and remove its join, doing so should resolve the issue. But I'd like to check that I have understood things before I start deleting stuff!

Cheers
Rob
 
Hi Rob,
You are correct but the reason i joined the tenders_register table is that i wanted the tender number available on the tender_invitee form. Reason being that i want to organise the uploaded filles that the vendors will submit.
The structure i decided on is a folder in the root named lptenders then within that there will be a subfolder per Tender and within that a subfolder per vendor.

My planned workaround was to actually build a little function that will copy in the tendernumber to the tender_invitation table when he gets invited. This will have to tombe done everytime the form opens though as i have to think what would happen if the procurement guys changes the tender number.
I thought that by joining the tables the tender number will be dynamically correct.
If you are saying that is the only way then i suppose that is the only way then. Not ideal

Same reason for linking in the vendor to user as i need to have the vendor subfolder the name of the VENDOR but there coulD be more than one user per vendor registered.

So if i reduce the joins to get the linking correct and new records correct then i will have to add more functions. I still battle a little bit with the Java->.js->user_ajax but suppose i will just have to apply myself an pursue that. I was howev also wondering if that will not slow down the form processing
 
HI
You are correct but the reason i joined the tenders_register table is that i wanted the tender number available on the tender_invitee form.

Is this not simply the tender_invitations.tender_id element?

In general the tender_invitations.tender_id should be a database join element. Then you can display the tender number which maintaining the underlying relationship between the tender and the tender invite.

I'm still not convinced you need additional code and workarounds to do what you need to do
 
I COULD use the tender id but i wanted to let the folder name be the actual tender number. I do understand that the id will achieve the segregation of the data as i require ...i did want the actual folder name to be the contract number but is is definitly not possible to do it with a join then i must pursue the other way.


I must then think about this. I could move the solution upstream as well.
If we move/ftp the data off , during THAT process. will i then have to first do a sql odbc connect to the site to map the folders to the tender name and change those id's to more intelligent names as the procurement guys will not know which "id" in the folder belongs to which tender

So maybe the copy tender name function will then be the workaround that I will then just have to do as it will be simpler and more stable doing the bit of extra fabrik work, it will not be end of the world for me.

I will see if i can create one function that i can call , pass the id, let the php return the tender number to .js back to java to update the elemnt ( or even thinking better, even maybe do a sql update directly into the tender_invitee table)

Does this now finally confirm that by joining the extra table causes then link-->filter to fail and does not support the saving of the key field when saving the child record.
If it does i believe you should document this somehow in the wiki to manage expectations when using this functionality. I have a Fabrik FAQ list building up on my sharepoint portal where i will certainly document this so i do not step into this trap again.
 
Ah, just digested your response a bit further. A one stage i DID have the tender_id as a databasejoin field exactly as you described but during one of your github iterations stopped doing the auto-pre-filter when sending the link id. The only way i could get it back was to change to the field integer.

I can only try that tomorrow night (unless you want to quickly do that, i have no problem you doing it as i am in limbo at this point anyway if you will not consider that to be a waste of your time.

In the bronze thread where I actually did report that issue I did consider that to be the ideal solution anyway but no one at the time responded to that and i had to move on. If i then reference that field in my fileupload folder definition will it then use the displayed/label value and not the actually id value?
 
hi

Probably best if you try (perhaps back up first) - then if its not what you expected you can revert easily.

If i then reference that field in my fileupload folder definition will it then use the displayed/label value and not the actually id value?
I would expect (although I have not tested) that if you set the tendor_id to be a database join then in the fileupload element you would be able to use one of two placeholders:

{tender_invitations___tender_id} -the label that the database join element uses
{tender_invitations___tender_id_raw} - the id that the database join stores in the db
 
Hi Rob,
I am now back from my trip and can try and move forward now ..

I first upgraded to .452 (I see it is now 3.07)

Testing the "Invite Vendors to Tender"

I tested on your Rob Test Record.


1. I removed the join from the Tender Invitation List (8)
2. I then link is TenderRegister (ID) to TenderInvitation (Tender_ID)
3. The Tender_ID element is a databasejoin
Value = ID and Label = ID
4. When you keep it as that it works. Shows the correct linked records and I also added an invitation and it retained the link.
5. To achieve my Tender Number objective I then changed to Label=Tender_Number

Now it loses the link and shows "No Records"

When I change the Label back to ID , it works

Surely the underlying link should be on the Raw Value?

I expected the link to work on the value and when I use the field in the {tender_invitations___tender_id} then it should be able get the label in the folder definition.
That will be perfect and eliminate all the other funny workarounds I had to consider....

I will now have to wait for you to confirm that this behavior is indeed correct or is a bug from your
perspective. If is is I will have to choose an alternative direction.
 
Ok, while waiting I thought about a little better solution and tried that.

I added a new tender_number field (databasejoin) field to my tender_invitee list
on the proc_tender_invitation group. I made the value tenders_register.id and the label the tenders_register.tender_number.

The way I schemed was I have to update/invite the vendor_id anyway so I added on change javascript event there. The thinking was that If I update THAT field with the tender_id during the change then it would display the tender_number and I could then use THAT in the fileupload folder definition

(you can access it here ...)
$http://databook.co.za/lptenders/adm...ion=com_fabrik&view=element&layout=edit&id=40

well...
var tendernumber = $('tender_invitees___tender_id').value;
$('tender_invitees___tender_number').value = tendernumber;

leaves the tender_number blank

if I READ the tender_id visually (3) and substitute it in the code :

var tendernumber = $('tender_invitees___tender_id').value;
$('tender_invitees___tender_number').value = 3;

then it behaves as expected and displays 201303 as the tender number.

So clearly the tendernumber var is not loading the tender_id value as expected ...

Can you please check what's wrong with my syntax?
 
I have a "testing" field on my form and decided to write the tendernumber read with

var tendernumber = $('tender_invitees___tender_id').value;

into it.

It says "undefined"

That explains it, I thought I followed the syntax correctly to read the tender_id

even tried adding a "raw" but no luck ....
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top