Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Unpublished records visible in referenced Forms 04 May 2016 17:38 #13927

Hi Everyone.

I have created a basic invoicing component. :)

I have a Client table for my clients details - including the publish field (installed by the wizard).

I then have a table for my invoices, which references my Client table. For new invoices, I have an Invoice form with a Client dropdown list field.

If I unpublish a particular Client record - I still see that client in my Clients dropdown list in my Invoice form.

Shouldn't unpublished records be hidden by default in referenced forms?

Cheers!
Just call me Chris :)

Please Log in or Create an account to join the conversation.

Unpublished records visible in referenced Forms 10 May 2016 20:09 #13946

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
This is normal, you need to use the « Propagate option » of your FK.
In the builder, open your table ‘Invoices’, and open the properties of the FK linking to Client.
Then tick the option « Propagate access »

You are done.
Cook Self Service is very powerful on its small details that nobody sees.
You can even cascade them.

Hope it helps and solve your problem
Coding is now a piece of cake
The following user(s) said Thank You: organicwebs

Please Log in or Create an account to join the conversation.

Unpublished records visible in referenced Forms 13 May 2016 04:54 #13962

Thanks Chef,

It doesn't seem to work for me. I have now checked the "Propagate Access" and rebuilt in the sandbox - but I still see unpublished Clients when creating a new Invoice record (when creating a new "Sale item" in my sandbox build).

(For others... FK stands for Foreign Key).

Also, in the jcook interface, Foreign Key is spelt wrong. I think "Foreing" should be "Foreign" (or maybe that is French spelling?).

Cheers
Just call me Chris :)

Please Log in or Create an account to join the conversation.

Unpublished records visible in referenced Forms 13 May 2016 11:13 #13963

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Ok.

This is absolutely normal.
Imagine that your item is populated with a unpublished Client, then when you edit the item, you may brake that link.
But your suggestion is accepted of course.
I will add some filter for that.

Hold on.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Unpublished records visible in referenced Forms 13 May 2016 11:35 #13964

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Added fonctionality.

Now you can define 'applyAccess' to true in your concerned fields.
JDom::_('html.form.select', array(
..
'applyAccess' => true
));

or
You can define the same parameter in the XML form file.

This is manual at the moment because it can be dangerous.
If you edit again an 'Expense' wich has now it Client unpublished, and save... then you will brake that link.

I need now to create a snipplet that handle the case when an unpublished item has been set previously in FK, so that a user cannot break the link saving the form.
Well, for you this is solved, but in terms of consistency, I need to add some securities.

Guess you know what you do... lol
Correct ? Understood ?
Coding is now a piece of cake
The following user(s) said Thank You: organicwebs

Please Log in or Create an account to join the conversation.

Unpublished FK records visible in referenced Forms 02 Jul 2021 11:01 #15844

Hi Chef,

Hope you are well :)

This is not a fix because, like you say, when the user opens an existing form - all UNPUBLISHED FK values are instantly lost (without warning too). This is very bad and not useable.

If possible... it would be good if the FK field keeps its old UNPUBLISHED FK value. Only when the FK Dropdownbox is clicked should it show a list of PUBLISHED FK options.

I think we need a solution, because this is the purpose of the PUBLISH state. (To hide but not delete).

Cheers
Just call me Chris :)

Please Log in or Create an account to join the conversation.

Last edit: by organicwebs.
  • Page:
  • 1
Time to create page: 0.060 seconds
  Love COOKING with COOK It has all the ingredients for a delicious Joomla component!
audibleid (Forum)

Get Started