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

JCckContent::foreach or forloop::Nesting is Alphabetical #321

Closed
Bucklash opened this issue Nov 25, 2016 · 2 comments
Closed

JCckContent::foreach or forloop::Nesting is Alphabetical #321

Bucklash opened this issue Nov 25, 2016 · 2 comments
Milestone

Comments

@Bucklash
Copy link
Contributor

Bucklash commented Nov 25, 2016

Hi folks...

Creating USERGROUP with JCckContent....

(Not sure if this has ANYTHING AT ALL to do with Seblod....)

... choice of arrays ...
$arrayIndexed('zebra', 'aadvark', 'dog', 'bear' );
$arrayAssociative(0 => 'zebra', 1 => 'aadvark', 2 => 'dog', 3 => 'bear' );

... choice of loops ...
for($i=0;$i<$arrayIndexed.length;$i++) { $newJCcKContentStuff = new JCckContent( etc.... }
or
foreach($arrayAssociative as $k => $v) { $newJCcKContentStuff = new JCckContent( etc.... }

Either way, when the usergroup is created, the nesting is done alphabetically, rather than in the order they are created
I would expect:
id = 1 | title = 'zebra' | lft = 1 | rgt = 2
id = 2 | title = 'aadvark' | lft = 3 | rgt = 4
id = 3 | title = 'dog' | lft = 5 | rgt = 6
id = 4 | title = 'bear' | lft = 7 | rgt = 8

But I get:

id = 1 | title = 'zebra' | lft = 7 | rgt = 8
id = 2 | title = 'aadvark' | lft = 1 | rgt = 2
id = 3 | title = 'dog' | lft = 3 | rgt = 4
id = 4 | title = 'bear' | lft = 5 | rgt = 6...

Thanks

Jon

@sebastienheraud sebastienheraud added this to the SEBLOD 3.16.x milestone Jul 10, 2018
@sebastienheraud
Copy link
Member

Hi Jon,

The tree is automatically rebuilt alphabetically after each new entry. That's on the Joomla! core side.
You'll see the same behaviour while creating using the UI.

I'm closing it now.

Saba

@Bucklash
Copy link
Contributor Author

Bucklash commented Apr 6, 2019

Ok, thanks :D

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

No branches or pull requests

2 participants