• Home
  • Support
  • Forum
  • Cobalt 8
  • Request :: Add view_what option to hide expired records from modules regardless of global type settings

Jeff VIP
Total posts: 745
27 Oct 2014 00:37

Hi,

I would like to be able to hide expired records in a module AND show expired records in the record list view. This can be achieved by adding hide_expired to the view_what options.

Example A showcase module to promote records that have been prolonged after payment.

Best regards, Jeff

Last Modified: 25 Dec 2014


Sergey
Total posts: 13,748
28 Oct 2014 02:54

If you order them by last modified, then expired will not get into the list I think. Will it?


Jeff VIP
Total posts: 745
28 Oct 2014 03:00

Sergey If you order them by last modified, then expired will not get into the list I think. Will it?

They need to be ordered by a fixed date like creation date. I can't use by last modified because it will mess up the order. :-(

The list also has to include records that never expire and they won't show up if I use sort by last modified.


Konstantin
Total posts: 1,113
31 Oct 2014 03:48

Added exclude_expirei in module settings.


Jeff VIP
Total posts: 745
31 Oct 2014 05:51

Konstantin Added exclude_expirei in module settings.

Great!

Does this also mean I can use $view_what = "exclude_expired" as part of a query in a custom module?


Konstantin
Total posts: 1,113
31 Oct 2014 11:04

Yes


Jeff VIP
Total posts: 745
01 Nov 2014 00:47

+1


pepperstreet VIP
Total posts: 3,837
02 Nov 2014 14:36

+1


Jeff VIP
Total posts: 745
22 Dec 2014 01:07

$view_what = "exclude_expired" shows nothing after update :-(


Konstantin
Total posts: 1,113
22 Dec 2014 07:25

What and where not showing?


Konstantin
Total posts: 1,113
23 Dec 2014 04:17

Can you check 'exclude_expired' in default cobalt module records, if there work than some issue in your module.


Jeff VIP
Total posts: 745
24 Dec 2014 00:30

Konstantin Can you check 'exclude_expired' in default cobalt module records, if there work than some issue in your module.

I will do that. But my module was working fine until recently :-(

I didn't make any code changes, so I am really puzzled...


Jeff VIP
Total posts: 745
24 Dec 2014 01:00

I have checked cobalt module records and it works fine with 'exclude_expired'

I have checked my custom module with $view_what="view_all" settings and it shows records including expired ones.

I have checked my custom module with $view_what="exclude_expired" settings and it shows no records.


Konstantin
Total posts: 1,113
24 Dec 2014 05:12

I can only advise you it's var_dump sql from model records and look into query, I think than you understand why return nothing.


Sergey
Total posts: 13,748
25 Dec 2014 13:58

I can suggest you to turn on debug mode and find SQL query that is produced by API for your module and see what is wrong there. If you cannot find in qery anything, copy it here and I'll have a look.

Powered by Cobalt