I would like to spend 2 blocks, the 1st block with the 1st item and the 2nd block with the 2nd item.
If I limit the output, for the 1st block 1 item and offset 0, I get the 2nd item.
If I do the same for the 2nd block and offset 1, the same will come out (correct and normal here)
Example output of the news. the first 2 news should be output in individual blocks.
this problem arises when the creation date is exactly the same to the second and you sort by creation date (Content: Written on (descending)).
Example
Node 1: 30.01.2020 13:45:23
Node 2: 30.01.2020 13:45:23
Comments
Comment #2
swatichouhan012 commentedComment #3
swatichouhan012 commented@HeavyStoneHead I checked issue with your steps but didn't get any issue in view module . i am getting right result as it should be.
Steps which i followed.
step 1 ) created 2 nodes. Node 1 and node 2 both have same creation date "30.01.2020 13:45:23".
Step 2) created a view with 2 different view block Block 1, Block 2.
Step 3) In Block 1 content is in descending order and offset set to 0 with limit 1 ,,, in this case i am getting "Node 2" as result of first block
Step 4 ) in Block 2 content us in desending order and offet set to 1 with limit 1.... Now i am getting "Node 1" as result of second block.
Its working as expected i am adding screenshot here please recheck and make sure both block are should be "Block override inplace of "All Display".
Comment #4
lendudeBased on #3, tagging for steps to reproduce on a clean Drupal install.
Comment #5
heavystoneheadI had problems reproducing, especially with a new installation. I think the problem is that you also need a third content that is older
Comment #6
longwaveThis is a deterministic sort order problem in MySQL, which is documented at https://dev.mysql.com/doc/refman/5.7/en/limit-optimization.html and also in a number of MySQL bug reports e.g. https://bugs.mysql.com/bug.php?id=72076 - the relevant sentence is:
The fix is to add a secondary sort by something that is unique, such as node ID; this will guarantee that there is only one possible order that the results can be returned in.
I don't think we should consider this a bug in Drupal, rather a limitation in the underlying database engine; we can't automatically add a secondary sort as it is possible this is not always wanted.