Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Reorder by drag and drop the featured articles, do not save the correct order in the administrator area #35728

Closed
carlitorweb opened this issue Oct 2, 2021 · 9 comments

Comments

@carlitorweb
Copy link
Member

carlitorweb commented Oct 2, 2021

Steps to reproduce the issue

  1. Create 2 categories
  2. Create 1 article inside each category.
  3. Put as Featured both articles
  4. In the administrator side, go to the Featured Articles view, and reorder the articles using the drag and drop characteristic.
  5. Refresh the administrator Featured Articles view

Expected result

Both articles keep the order you establish

Actual result

The articles did not respect the order you established, and back to the same initial order they had.

System information (as much as possible)

A fresh J4.0.3 site in: https://launch.joomla.org/

Additional comments

If you do the same, but having both articles in the same category, all work as expected.

@brianteeman
Copy link
Contributor

In the menu item you need to set Category to no-order and Articles to featured-order

image

@carlitorweb
Copy link
Member Author

carlitorweb commented Oct 3, 2021

In the menu item you need to set Category to no-order and Articles to featured-order

image

But this is also needed for the administrator area? What I reporting here is only inside the administrator area, not in the frontend where that menu item should have effect.

Anyway, I tested and after create a menu item in a fresh 4.0.3, who have this options you mention, do not cause any change.

@brianteeman
Copy link
Contributor

Sorry I misunderstood your original post

@carlitorweb
Copy link
Member Author

carlitorweb commented Oct 3, 2021

@brianteeman is okay, maybe I did not explain myself as good as I though. I trying find the problem, but so far the method saveOrderAjax() and saveorder($pks = array(), $order = null) look good. Seen is some kind of js problem...somehow do not let the table->store(), save the correct values in the frontpage table when the articles come from a different category.
But then, all work okay when come from the same category and that make the js assumption invalid.

In all my sites, the users use this view, so is kind of a critical problem for me.

@carlitorweb carlitorweb changed the title [4.0] Reorder featured articles, is not respecting the order you establish if the articles come from a different category [4.0] Reorder by drag and drop the featured articles, do not save the correct order in the administrator area Oct 3, 2021
@dgrammatiko
Copy link
Contributor

@carlitorweb can you test removing the data-draggable-group="<?php echo $item->catid; ?>" from

<tr class="row<?php echo $i % 2; ?>" data-draggable-group="<?php echo $item->catid; ?>"

@carlitorweb
Copy link
Member Author

carlitorweb commented Oct 3, 2021

@carlitorweb can you test removing the data-draggable-group="<?php echo $item->catid; ?>" from

<tr class="row<?php echo $i % 2; ?>" data-draggable-group="<?php echo $item->catid; ?>"

It worked like a charm! You save my day, thank you. Do you think this change could cause any break in other place? I do not think can cause any problem, but just for be sure

@dgrammatiko
Copy link
Contributor

No, that piece of code shouldn’t be there in that view. How do I know? I wrote the first version of drag and drop 😄

@dgrammatiko
Copy link
Contributor

dgrammatiko commented Oct 3, 2021

@carlitorweb if you can mark your successful test in the issues.joomla.org the fix would be available in one of the next versions. The PR is #35741

@richard67
Copy link
Member

Closing as having a pull request. Please test #35741 . Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants