41 Posts
mlep
7 years ago
Topic

Hi,

After update (seblod 3.11.3) I encountred this problem :

I have a parent list (list of monthes) that calls a child list (list of created elements during the month).

I call my child list with a SEBLOD list field and for fields options first-day-of-month and last-day-of-month.

These two fields are calculated in a before render code


Before update, first-day-of-month and last-day-of-month where send correctly to SEBLOD list field options. That is what the debug wrote for May :

SELECT t0.id AS pid,t0.pk AS pk,t0.pkb AS pkb,t0.parent_id AS parent,t0.author_id AS author,t0.cck AS cck,t0.storage_location AS loc,tt.id AS type_id,tt.alias AS type_alias
FROM `#__cck_core` AS t0
LEFT JOIN `#__content` AS t1 ON t1.id = t0.pk
LEFT JOIN `#__cck_core_types` AS tt ON tt.name = t0.cck
WHERE t1.state = 1
AND t1.access IN (1,1,2,3,6,7)
AND ( t1.publish_up = '0000-00-00 00:00:00' OR t1.publish_up <= '2017-06-14 13:49' )
AND ( t1.publish_down = '0000-00-00 00:00:00' OR t1.publish_down >= '2017-06-14 13:49' )
AND t1.created >= '2017-05-01 00:00:00'
AND t1.created < '2017-05-31 00:00:00'
AND t0.cck = 'mplf'
ORDER BY t1.title ASC

SELECT COUNT(t0.id)
FROM `#__cck_core` AS t0
LEFT JOIN `#__content` AS t1 ON t1.id = t0.pk
LEFT JOIN `#__cck_core_types` AS tt ON tt.name = t0.cck
WHERE t1.state = 1
AND t1.access IN (1,1,2,3,6,7)
AND ( t1.publish_up = '0000-00-00 00:00:00' OR t1.publish_up <= '2017-06-14 13:49' )
AND ( t1.publish_down = '0000-00-00 00:00:00' OR t1.publish_down >= '2017-06-14 13:49' )
AND t1.created >= '2017-05-01 00:00:00'
AND t1.created < '2017-05-31 00:00:00'
AND t0.cck = 'mplf'

0.113 seconds (0.049); 16.37 MB (1.625) - afterSearch [Cache=OFF] = 6 results.

After update, first-day-of-month and last-day-of-month are not calculated by before render code. The created date is the first created element :

SELECT t0.id AS pid,t0.pk AS pk,t0.pkb AS pkb,t0.parent_id AS parent,t0.author_id AS author,t0.cck AS cck,t0.storage_location AS loc,tt.id AS type_id,tt.alias AS type_alias
FROM `#__cck_core` AS t0
LEFT JOIN `#__content` AS t1 ON t1.id = t0.pk
LEFT JOIN `#__cck_core_types` AS tt ON tt.name = t0.cck
WHERE t1.state = 1
AND t1.access IN (1,1,2,3,6,7)
AND ( t1.publish_up = '0000-00-00 00:00:00' OR t1.publish_up <= '2017-06-14 13:54' )
AND ( t1.publish_down = '0000-00-00 00:00:00' OR t1.publish_down >= '2017-06-14 13:54' )
AND t1.created >= '2016-10-27 16:40:50'
AND t1.created < '2016-10-27 16:40:50'
AND t0.cck = 'mplf'
ORDER BY t1.title ASC

SELECT COUNT(t0.id)
FROM `#__cck_core` AS t0
LEFT JOIN `#__content` AS t1 ON t1.id = t0.pk
LEFT JOIN `#__cck_core_types` AS tt ON tt.name = t0.cck
WHERE t1.state = 1
AND t1.access IN (1,1,2,3,6,7)
AND ( t1.publish_up = '0000-00-00 00:00:00' OR t1.publish_up <= '2017-06-14 13:54' )
AND ( t1.publish_down = '0000-00-00 00:00:00' OR t1.publish_down >= '2017-06-14 13:54' )
AND t1.created >= '2016-10-27 16:40:50'
AND t1.created < '2016-10-27 16:40:50'
AND t0.cck = 'mplf'

0.088 seconds (0.034); 10.66 MB (1.561) - afterSearch [Cache=OFF] = 0 result.
0.088 seconds (0.000); 10.66 MB (0.001) - afterRender

I have checked many times my fields, configuration, template... No way... It seems like after update, before render code comes after SEBLOD list field and not in previous version.

I would appreciate any help !

Get a VIP membership
41 Posts
mlep
7 years ago
9
Level 1

I specify that I have checked every update of used fields

4229 Posts
Kadministrator
7 years ago
8
Level 2

So you are saying setting dates in beforeStore does not have any effect at all? Can you try if the same applies also if you add some other, e.g. text field?

41 Posts
mlep
7 years ago
7
Level 3

Yes, Klas. I have tried with a text field (name). In before render, I just give a value to the name field. This value would be passed to child list via option in Seblod list field (child_name=parent_name).

But the result is : all the elements in child list, no search apply. An the debug of child list :

AND ( t1.publish_up = '0000-00-00 00:00:00' OR t1.publish_up <= '2017-06-15 10:10' )
AND ( t1.publish_down = '0000-00-00 00:00:00' OR t1.publish_down >= '2017-06-15 10:10' )
AND t0.cck = 'mplf'
ORDER BY t1.title ASC
LIMIT 50

SELECT COUNT(t0.id)
FROM `#__cck_core` AS t0
LEFT JOIN `#__content` AS t1 ON t1.id = t0.pk
LEFT JOIN `#__cck_core_types` AS tt ON tt.name = t0.cck
WHERE t1.state = 1
AND t1.access IN (1,1,2,3,6,7)
AND ( t1.publish_up = '0000-00-00 00:00:00' OR t1.publish_up <= '2017-06-15 10:10' )
AND ( t1.publish_down = '0000-00-00 00:00:00' OR t1.publish_down >= '2017-06-15 10:10' )
AND t0.cck = 'mplf'

0.019 seconds (0.019); 4.98 MB (4.982) - afterSearch [Cache=OFF] = 2374 results.
0.036 seconds (0.017); 5.70 MB (0.715) - afterRender [Cache=OFF]

If I set a name in child list form, I get this in debug :

SELECT t0.id AS pid,t0.pk AS pk,t0.pkb AS pkb,t0.parent_id AS parent,t0.author_id AS author,t0.cck AS cck,t0.storage_location AS loc,tt.id AS type_id,tt.alias AS type_alias
FROM `#__cck_core` AS t0
LEFT JOIN `#__cck_store_form_mplf` AS t1 ON t1.id = t0.pk
LEFT JOIN `#__content` AS t2 ON t2.id = t0.pk
LEFT JOIN `#__cck_core_types` AS tt ON tt.name = t0.cck
WHERE t2.state = 1
AND t2.access IN (1,1,2,3,6,7)
AND ( t2.publish_up = '0000-00-00 00:00:00' OR t2.publish_up <= '2017-06-15 10:19' )
AND ( t2.publish_down = '0000-00-00 00:00:00' OR t2.publish_down >= '2017-06-15 10:19' )
AND t1.nom = 'cann'
AND t0.cck = 'mplf'
ORDER BY t2.title ASC
LIMIT 50

0.012 seconds (0.012); 4.51 MB (4.514) - afterSearch [Cache=OFF] = 2 results.
0.018 seconds (0.006); 5.07 MB (0.559) - afterRender [Cache=OFF]

Thank you, Klas to help me !

4229 Posts
Kadministrator
7 years ago
6
Level 4

Ok, please report this on the tracker, seems like a regression in latest Seblod version

4229 Posts
Kadministrator
7 years ago
5
Level 5

Also please mention this happens with all fields, not just calendar ones.

41 Posts
mlep
7 years ago
4
Level 6

Thank you Klas, done on Github. I hope it will be fixed soon !

7 years ago
3
Level 7

Hi,

It's because of the new plugin field priority that has appeared in 3.11.0

A quick and temporary fix is to set the same priority to the CCK List plugin field as the BeforeRender Field :

Replace line #61 of '/plugins/cck_field/cck_list/cck_list.php' file :

parent::g_addProcess( 'beforeRenderContent', self::$type, $config, array( 'name'=>$field->name, 'fieldnames'=>$options, 'pagination'=>$pagination ) );

By :

parent::g_addProcess( 'beforeRenderContent', self::$type, $config, array( 'name'=>$field->name, 'fieldnames'=>$options, 'pagination'=>$pagination ), 5 );

And be sure the BeforeRender field is BEFORE your List field in your view!

Let us know...

41 Posts
mlep
7 years ago
2
Level 8

Thank you Olivier ! The fix has solved my problem.

7 years ago
1
Level 9

Hello,

Fixed with the latest releases of SEBLOD 3.13 and Code Pack 1.5.0. Details available here.

Regards,
Saba.

41 Posts
mlep
7 years ago
0
Level 10

I confirm : fixed with priority. Thanks

Get a Book for SEBLOD