omeka-s-modules / Hierarchy

GNU General Public License v3.0
0 stars 1 forks source link

Testing: Hierarchy Module #1

Closed matthewjmckinley closed 1 week ago

matthewjmckinley commented 8 months ago

Create hierarchies of resources for organization and display. Each hierarchy can contain multiple nested groupings, and each grouping may optionally contain objects from a selected item set.

Please test:

Thanks!

allanaaa commented 1 month ago

On http://dev.omeka.org/amayer/amayer-s/omeka-s/s/my-omeka-s-site/hierarchy/75 I see all 61 items on the first page.

Screenshot 2024-09-11 at 05 00 23 Screenshot 2024-09-11 at 05 00 31

If I press the page buttons back and forth it will right itself, but when first getting to a browse page, it's just showing everything.

On http://dev.omeka.org/amayer/amayer-s/omeka-s/s/my-omeka-s-site/item-set/4255 I'm now seeing "1 of 1; 1-1 of 1 [items]" even though there are 490 items in that set.

On http://dev.omeka.org/amayer/amayer-s/omeka-s/s/my-omeka-s-site/hierarchy/68 I see all 490 items displayed on the first page although it says "1–18 of 490".

matthewjmckinley commented 1 month ago

Ah OK I wasn't counting the actual items. I see the issue now, and it's happening on my side too. I'll look into the pagination more

kimisgold commented 1 month ago

I've styled the hierarchy links to look like a tree, and decreased a lot of the margins and padding in the process. If this is too literal a visual, I can return it to something more list-like.

Regarding the sidebar width: the side-by-side links and item list styles are specific to the default theme, so I updated the markup and provided styles to make them a little more consistent across the themes.

matthewjmckinley commented 1 month ago

Thank you so much Kim, I think it works great! But I'll leave the final say-so on that up to Allana

allanaaa commented 1 month ago

I love the tree style! I think it's great and really visually helpful.

allanaaa commented 1 month ago

I just loaded a page edit and saw this:

Screenshot 2024-09-12 at 05 42 58

I don't think any of the page blocks here are set to hierarchies that no longer exist, so ... gotta be something else.

matthewjmckinley commented 1 month ago

I think that page block issue might have to do with not having any hierarchies assigned to that particular site. Even if the hierarchies exist, if they are not specifically assigned to that site under the Hierarchy page in the site admin sidebar, they will not show up as an option under the Hierarchy page block. it should just say "(No site hierarchies assigned)".

That particular Warning was due to not checking the Site Hierarchies array was populated before iterating through it. I just pushed a commit that SHOULD fix it, but let me know if it doesn't or the error messages change.

matthewjmckinley commented 1 month ago

@allanaaa Pagination bug fixed in latest commit. With that, I think/hope that this module is ready for final testing and hopefully documentation.

allanaaa commented 1 month ago

Sorry! Can we get that nice tree visual on the resource page block too? Right now I'm only seeing it on the hierarchy browse pages.

Screenshot 2024-09-23 at 13 52 24 Screenshot 2024-09-23 at 13 52 29

http://dev.omeka.org/amayer/amayer-s/omeka-s/s/my-omeka-s-site/hierarchy/68 vs. http://dev.omeka.org/amayer/amayer-s/omeka-s/s/my-omeka-s-site/item-set/4255

There is also a small issue with the tree visual, where the text "Shelf 2" is overlapping it, and I think it's generating an extra ... trunk? on the left side. Maybe it's when the hierarchy title is set to display.

It's showing in the page blocks, but it's also picking up that "width:30%" issue:

Screenshot 2024-09-23 at 13 54 23

http://dev.omeka.org/amayer/amayer-s/omeka-s/s/my-omeka-s-site/page/my-11-column-grid-page

matthewjmckinley commented 1 month ago

@kimisgold Would you mind incorporating the tree view into Resource Page Blocks, and taking a look at the issue Allana found above?

allanaaa commented 1 month ago

This change looks good.

There is still some grey bar behind the "Shelf 1" word here? And the whole tree has a superfluous bar: http://dev.omeka.org/amayer/amayer-s/omeka-s/s/my-omeka-s-site/page/collection-tree

As far as I can tell it's set up correctly so I don't know where that bar is coming from. I'm guessing because the lower-level groupings are hidden...

Screenshot 2024-09-30 at 14 57 47

The resource block for item sets is still showing empty-value groupings (neither a label nor an item set) though that's been fixed elsewhere: http://dev.omeka.org/amayer/amayer-s/omeka-s/s/my-omeka-s-site/item-set/4256

I would also find a way of styling the hierarchy names (Room 1, Room 2, etc.) in this display.

There is also a spacing issue between entries in the third hierarchy (Digital Exhibits @ UMKC Libraries). where I realize the tree is having an effect on the space between the "Barney Kessel" items but not the entries before and after. Could that all be made even?

allanaaa commented 1 month ago

One last question: Is there any way to get these links to point to the item set pages themselves, rather than the hierarchy browse pages, @matthewjmckinley? Could we introduce that as a setting? You can add the resource page block to item sets, and then the hierarchy displays, but then when you click into it, there's no way to get back to other item sets.

kimisgold commented 1 month ago

As far as I can tell it's set up correctly so I don't know where that bar is coming from. I'm guessing because the lower-level groupings are hidden...

Yes, it's due to empty list items in the tree. I remember an implementation with graceful fallback titles for hierarchy groupings without labels, but maybe it got missed in the public views.

kimisgold commented 1 month ago

I've made the top level hierarchy items more integrated into the tree structure, which I think also helps separate them from the hierarchy labels. The labels should appear bold in hierarchy-specific contexts, and normal weight in resource contexts where they may sit inline with other resource metadata.

matthewjmckinley commented 1 month ago

I've made a change so that grouping li items are skipped entirely if there is no label or itemSet assigned to the grouping, which should fix the two display issues mentioned above.

I'll look at making the links point to itemSet pages instead of Hierarchy pages as a config option (the original behavior, before we introduced Hierarchy specific landing pages). Is this a config setting you'd want to apply to all public pages, or just the itemSet resource page, specifically?

allanaaa commented 1 month ago

Things look mostly OK except this double-thick bar is still there:

Screenshot 2024-10-02 at 17 01 23

But that may be a vestige of that ghostly grouping-set that disappeared on me at some point. If nobody else building hierarchies sees this line anywhere, then it's probably fine.

allanaaa commented 1 month ago

I'll look at making the links point to itemSet pages instead of Hierarchy pages as a config option (the original behavior, before we introduced Hierarchy specific landing pages). Is this a config setting you'd want to apply to all public pages, or just the itemSet resource page, specifically?

That's a good question. I guess for the sake of saving time it could be a setting that only applies to the item-set resource page. Or maybe, if a grouping is set to a specific item set AND only its contents are displaying (i.e. if the "combine" setting is off) then we could display the link to the item set view page somewhere? I'm not sure. It just seems odd that you can't get to the resource page from anywhere.

matthewjmckinley commented 1 month ago

I agree with you that it's odd to not be able to get back to an item set when all these hierarchy groupings are populated by item set--but I also see this hierarchy sidebar/landing page as It's Own Thing, and its useful to have a separate hierarchy grouping page apart from the associated item set for customizing, styling, etc. especially as we work to integrate ArchivesSpace. I feel like linking back to item sets from directly within the hierarchy tree would maybe muddy the waters and confuse people as to whether they are looking at a hierarchy, or an item set, on any given page.

How about this: what if for whatever given hierarchy grouping page we are on, I include a line directly beneath the hierarchy tree in the sidebar saying:

That way the item sets are right there to navigate to, AND I think it may make it clearer to the user, when a hierarchy grouping is combined with sub-groubings, that the items shown on screen are drawn from all the listed item sets.

Thoughts?

allanaaa commented 1 month ago

Just got an error trying to name two hierarchies the same thing. Shouldn't we be able to reuse names, and just save hierarchies according to some internal ID?

Omeka S encountered an error

Doctrine\DBAL\Exception\UniqueConstraintViolationException An exception occurred while executing 'INSERT INTO hierarchy (label, position) VALUES (?, ?)' with params ["Room 1", 4]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Room 1' for key 'UNIQ_FA7A28AEEA750E8'

Details:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Room 1' for key 'UNIQ_FA7A28AEEA750E8' in /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117 Stack trace:

0 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(117): PDOStatement->execute(NULL)

1 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(179): Doctrine\DBAL\Driver\PDOStatement->execute(NULL)

2 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(226): Doctrine\DBAL\Statement->execute(NULL)

3 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(276): Doctrine\DBAL\Statement->executeStatement()

4 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1128): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts()

5 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(425): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))

6 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(392): Doctrine\ORM\UnitOfWork->commit(NULL)

7 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(357): Doctrine\ORM\EntityManager->flush()

8 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Manager.php(224): Omeka\Api\Adapter\AbstractEntityAdapter->create(Object(Omeka\Api\Request))

9 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Manager.php(78): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))

10 /var/www/html/amayer/amayer-s/omeka-s/application/src/Mvc/Controller/Plugin/Api.php(99): Omeka\Api\Manager->create('hierarchy', Array, Array, Array)

11 /var/www/html/amayer/amayer-s/omeka-s/modules/Hierarchy/src/Controller/IndexController.php(56): Omeka\Mvc\Controller\Plugin\Api->create('hierarchy', Array)

12 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Hierarchy\Controller\IndexController->indexAction()

13 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))

14 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

15 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

16 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))

17 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))

18 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

19 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

20 /var/www/html/amayer/amayer-s/omeka-s/index.php(21): Laminas\Mvc\Application->run()

21 {main}

Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Room 1' for key 'UNIQ_FA7A28AEEA750E8' in /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18 Stack trace:

0 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(119): Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))

1 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(179): Doctrine\DBAL\Driver\PDOStatement->execute(NULL)

2 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(226): Doctrine\DBAL\Statement->execute(NULL)

3 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(276): Doctrine\DBAL\Statement->executeStatement()

4 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1128): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts()

5 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(425): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))

6 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(392): Doctrine\ORM\UnitOfWork->commit(NULL)

7 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(357): Doctrine\ORM\EntityManager->flush()

8 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Manager.php(224): Omeka\Api\Adapter\AbstractEntityAdapter->create(Object(Omeka\Api\Request))

9 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Manager.php(78): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))

10 /var/www/html/amayer/amayer-s/omeka-s/application/src/Mvc/Controller/Plugin/Api.php(99): Omeka\Api\Manager->create('hierarchy', Array, Array, Array)

11 /var/www/html/amayer/amayer-s/omeka-s/modules/Hierarchy/src/Controller/IndexController.php(56): Omeka\Mvc\Controller\Plugin\Api->create('hierarchy', Array)

12 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Hierarchy\Controller\IndexController->indexAction()

13 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))

14 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

15 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

16 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))

17 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))

18 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

19 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

20 /var/www/html/amayer/amayer-s/omeka-s/index.php(21): Laminas\Mvc\Application->run()

21 {main}

Next Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'INSERT INTO hierarchy (label, position) VALUES (?, ?)' with params ["Room 1", 4]:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Room 1' for key 'UNIQ_FA7A28AEEA750E8' in /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:74 Stack trace:

0 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(182): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDO\Exception))

1 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(159): Doctrine\DBAL\DBALException::wrapException(Object(Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(Doctrine\DBAL\Driver\PDO\Exception), 'An exception oc...')

2 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(2226): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(Doctrine\DBAL\Driver\PDO\Exception), 'INSERT INTO hie...', Array)

3 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(185): Doctrine\DBAL\Connection->handleExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\Exception), 'INSERT INTO hie...', Array, Array)

4 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(226): Doctrine\DBAL\Statement->execute(NULL)

5 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(276): Doctrine\DBAL\Statement->executeStatement()

6 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1128): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts()

7 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(425): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))

8 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(392): Doctrine\ORM\UnitOfWork->commit(NULL)

9 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(357): Doctrine\ORM\EntityManager->flush()

10 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Manager.php(224): Omeka\Api\Adapter\AbstractEntityAdapter->create(Object(Omeka\Api\Request))

11 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Manager.php(78): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))

12 /var/www/html/amayer/amayer-s/omeka-s/application/src/Mvc/Controller/Plugin/Api.php(99): Omeka\Api\Manager->create('hierarchy', Array, Array, Array)

13 /var/www/html/amayer/amayer-s/omeka-s/modules/Hierarchy/src/Controller/IndexController.php(56): Omeka\Mvc\Controller\Plugin\Api->create('hierarchy', Array)

14 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Hierarchy\Controller\IndexController->indexAction()

15 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))

16 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

17 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

18 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))

19 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))

20 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

21 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

22 /var/www/html/amayer/amayer-s/omeka-s/index.php(21): Laminas\Mvc\Application->run()

23 {main}

allanaaa commented 1 month ago

Does the order of hierarchies on the site-specific adding/removing page mean anything?

Screenshot 2024-10-04 at 13 03 01

On the public side, they appear to display in the order shown on the installation-wide setup page, not the order on the site setup.

Screenshot 2024-10-04 at 13 02 54

So either we could add this function or get rid of the "drag-and-drop" icons on the site-specific add/remove page.

allanaaa commented 1 month ago

I deleted the hierarchy with the visual issue, and recreated a similar one. I changed the "Combine hierarchy resources" setting on the site, and suddenly it collapsing like this?

Screenshot 2024-10-04 at 13 15 42

Just that one, not the other two on the same page. http://dev.omeka.org/amayer/amayer-s/omeka-s/s/my-omeka-s-site/page/collection-tree

allanaaa commented 1 month ago

Okay, this may help: if a grouping has no label AND no item set, AND the resource counts are turned off, then there is absolutely no text to display and the tree collapses badly.

Screenshot 2024-10-07 at 12 17 04

But if you add any text back it's fine.

Screenshot 2024-10-07 at 12 16 45
allanaaa commented 1 month ago

In Thanks Roy, the hierarchy labels are landing in an odd spot:

Screenshot 2024-10-07 at 12 20 06
allanaaa commented 1 month ago

In Foundation the trees aren't appearing at all, although the resource block is loading the title:

Screenshot 2024-10-07 at 12 21 27
allanaaa commented 1 month ago

It looks good in Default, The Daily, Papers, Lively, Center Row, Cozy, and Freedom.

kimisgold commented 1 month ago

I'll take a look at what's happening in Thanks, Roy.

matthewjmckinley commented 1 month ago
  1. I can't recreate the same label database error -- there's no constraints in the SQL definitions that say a Hierarchy label must be unique, and I've successfully saved several different hierarchies with the same name. Can you consistently recreate this issue on the latest code? It may have been some other database weirdness that caused the error.
  2. I'll look in to having the public site views reflect the hierarchy placement on the Site Hierarchies page, and if it's not possible I'll remove the drag-and-drop altogether.
  3. For the tree collapsing oddly, I've just pushed a commit that avoids printing any link text whatsoever if there is no label or itemset for a grouping. However, it's still happening, because I think I need(?) to print an 'empty' UL tag to make the nested unordered list behave properly, especially if the unlabeled grouping has a parent and child (i.e. its the middle piece of a nested list). @kimisgold is the tree bar appearing for 'empty' ULs that still have child ULs something that can be accounted for in the CSS? Or do I need to rethink how I'm building these nested lists?
  4. I'll take a look why things aren't appearing in Foundation.
  5. @allanaaa What do you think about my solution for linking to item sets from a hierarchy outlined above? Want to make sure I have buy-in before I code it.
allanaaa commented 1 month ago

Just updated and tried again for #1.

Doctrine\DBAL\Exception\UniqueConstraintViolationException An exception occurred while executing 'INSERT INTO hierarchy (label, position) VALUES (?, ?)' with params ["Room 1", 4]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Room 1' for key 'UNIQ_FA7A28AEEA750E8'

Details:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Room 1' for key 'UNIQ_FA7A28AEEA750E8' in /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117 Stack trace:

0 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(117): PDOStatement->execute(NULL)

1 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(179): Doctrine\DBAL\Driver\PDOStatement->execute(NULL)

2 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(226): Doctrine\DBAL\Statement->execute(NULL)

3 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(276): Doctrine\DBAL\Statement->executeStatement()

4 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1128): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts()

5 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(425): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))

6 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(392): Doctrine\ORM\UnitOfWork->commit(NULL)

7 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(357): Doctrine\ORM\EntityManager->flush()

8 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Manager.php(224): Omeka\Api\Adapter\AbstractEntityAdapter->create(Object(Omeka\Api\Request))

9 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Manager.php(78): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))

10 /var/www/html/amayer/amayer-s/omeka-s/application/src/Mvc/Controller/Plugin/Api.php(99): Omeka\Api\Manager->create('hierarchy', Array, Array, Array)

11 /var/www/html/amayer/amayer-s/omeka-s/modules/Hierarchy/src/Controller/IndexController.php(56): Omeka\Mvc\Controller\Plugin\Api->create('hierarchy', Array)

12 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Hierarchy\Controller\IndexController->indexAction()

13 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))

14 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

15 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

16 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))

17 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))

18 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

19 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

20 /var/www/html/amayer/amayer-s/omeka-s/index.php(21): Laminas\Mvc\Application->run()

21 {main}

Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Room 1' for key 'UNIQ_FA7A28AEEA750E8' in /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18 Stack trace:

0 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(119): Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))

1 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(179): Doctrine\DBAL\Driver\PDOStatement->execute(NULL)

2 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(226): Doctrine\DBAL\Statement->execute(NULL)

3 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(276): Doctrine\DBAL\Statement->executeStatement()

4 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1128): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts()

5 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(425): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))

6 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(392): Doctrine\ORM\UnitOfWork->commit(NULL)

7 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(357): Doctrine\ORM\EntityManager->flush()

8 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Manager.php(224): Omeka\Api\Adapter\AbstractEntityAdapter->create(Object(Omeka\Api\Request))

9 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Manager.php(78): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))

10 /var/www/html/amayer/amayer-s/omeka-s/application/src/Mvc/Controller/Plugin/Api.php(99): Omeka\Api\Manager->create('hierarchy', Array, Array, Array)

11 /var/www/html/amayer/amayer-s/omeka-s/modules/Hierarchy/src/Controller/IndexController.php(56): Omeka\Mvc\Controller\Plugin\Api->create('hierarchy', Array)

12 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Hierarchy\Controller\IndexController->indexAction()

13 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))

14 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

15 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

16 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))

17 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))

18 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

19 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

20 /var/www/html/amayer/amayer-s/omeka-s/index.php(21): Laminas\Mvc\Application->run()

21 {main}

Next Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'INSERT INTO hierarchy (label, position) VALUES (?, ?)' with params ["Room 1", 4]:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Room 1' for key 'UNIQ_FA7A28AEEA750E8' in /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:74 Stack trace:

0 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(182): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDO\Exception))

1 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(159): Doctrine\DBAL\DBALException::wrapException(Object(Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(Doctrine\DBAL\Driver\PDO\Exception), 'An exception oc...')

2 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(2226): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(Doctrine\DBAL\Driver\PDO\Exception), 'INSERT INTO hie...', Array)

3 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(185): Doctrine\DBAL\Connection->handleExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDO\Exception), 'INSERT INTO hie...', Array, Array)

4 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(226): Doctrine\DBAL\Statement->execute(NULL)

5 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(276): Doctrine\DBAL\Statement->executeStatement()

6 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1128): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->executeInserts()

7 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(425): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))

8 /var/www/html/amayer/amayer-s/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(392): Doctrine\ORM\UnitOfWork->commit(NULL)

9 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(357): Doctrine\ORM\EntityManager->flush()

10 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Manager.php(224): Omeka\Api\Adapter\AbstractEntityAdapter->create(Object(Omeka\Api\Request))

11 /var/www/html/amayer/amayer-s/omeka-s/application/src/Api/Manager.php(78): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))

12 /var/www/html/amayer/amayer-s/omeka-s/application/src/Mvc/Controller/Plugin/Api.php(99): Omeka\Api\Manager->create('hierarchy', Array, Array, Array)

13 /var/www/html/amayer/amayer-s/omeka-s/modules/Hierarchy/src/Controller/IndexController.php(56): Omeka\Mvc\Controller\Plugin\Api->create('hierarchy', Array)

14 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Hierarchy\Controller\IndexController->indexAction()

15 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))

16 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

17 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

18 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))

19 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))

20 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

21 /var/www/html/amayer/amayer-s/omeka-s/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

22 /var/www/html/amayer/amayer-s/omeka-s/index.php(21): Laminas\Mvc\Application->run()

23 {main}

Same for the other hierarchies I already have, which shouldn't have any errors in them:

Doctrine\DBAL\Exception\UniqueConstraintViolationException An exception occurred while executing 'INSERT INTO hierarchy (label, position) VALUES (?, ?)' with params ["Digital Exhibits @ UMKC Libraries", 4]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Digital Exhibits @ UMKC Libraries' for key 'UNIQ_FA7A28AEEA750E8'

matthewjmckinley commented 4 weeks ago

Something is messing up with the hierarchy ID check in the index controller, and it looks like it's trying to create a new record instead of updating an existing record. That or the database is not auto incrementing record IDs correctly.

Are you able to create a new hierarchy, with our without an identical name to an existing hierarcy?

allanaaa commented 4 weeks ago

I can create ones with new names fine. I can't create one with an existing name.

matthewjmckinley commented 4 weeks ago

How odd, having no issues on my end. Maybe something got corrupted in your database? If so, an uninstall/reinstall of the module would drop and recreate the Hierarchy tables and should fix.

zerocrates commented 4 weeks ago

label used to have a unique index and had no upgrade corresponding to the change to remove it, so yes, you would expect an uninstall/reinstall to fix this issue

matthewjmckinley commented 4 weeks ago

Ah, there it is. I remember now that I wasn't sure whether to upgrade the version because the module is pre-release, but I guess I should have done it to trigger the upgrade button.

Looking back, I do see that I recommended a re-install on June 26, but it got so buried in this labyrinthian testing thread that it's no surprise Allana missed it and I totally forgot it. I'll make sure to do it the right way and upgrade for any DB changes, even before release, in the future.

allanaaa commented 4 weeks ago

Great! Thanks, that fixed the duplicate-label issue. It didn't fix the theme issues in Foundation or Thanks Roy, and the tree-collapse issue is still there too.

As for

How about this: what if for whatever given hierarchy grouping page we are on, I include a line directly beneath the hierarchy tree in the sidebar saying: "Contains resources from [link to item set]" for the un-combined setting "Contains resources from [link to item set][link to child item set][link to grandchild item set][etc.]" for combined setting Don't display anything if its a grouping without an assigned itemset and/or combined child item sets

I think that would be fine - I like the idea of adding information rather than changing what we've already got. If we don't want to bother with a setting to turn this on and off, just stick this info in a div with an ID, and then users can disappear it with CSS if they want to.

matthewjmckinley commented 3 weeks ago

OK, I've added the 'Contains Resource from' feature and put it in its own div.

Also hierarchies are now displaying in the order set on the Site Hierarchy Resource page on public site resource pages.

For Foundation, I've tried configuring the theme several different ways but am still seeing the hierarchy appear normally--is there anything special you're doing with the settings or on the Configure Resource page that might be affecting this?

Screen Shot 2024-10-09 at 3 44 22 PM

For Thanks Roy and the collapse issue, I've done what I can but I'd like Kim to at least review what's happening before I make any more changes (see my comment from Oct 7)

allanaaa commented 3 weeks ago

For Foundation, I've tried configuring the theme several different ways but am still seeing the hierarchy appear normally--is there anything special you're doing with the settings or on the Configure Resource page that might be affecting this?

I've just switched multiple sites (previously working with Hierarchy on other themes) over to Foundation and the issue appears each time. So, it might be an installation-wide issue for me personally. I think we can ignore it unless it pops up with a user issue.

kimisgold commented 2 weeks ago

@allanaaa I made changes to Thanks Roy that should fix its layout issue, as well as a change to the Hierarchy module that should now properly render the Hierarchy tree on an item set's show view. You'll need to pull both that theme and the module to see the fixes.

allanaaa commented 2 weeks ago

Most (not all) of the themes need more space to delineate between hierarchies. Can you put some bottom margin or padding on the ul.hierarchy-list? ("Room 1" and "Room 2" are the two hierarchies.)

Screenshot 2024-10-17 at 15 58 58 Screenshot 2024-10-17 at 16 00 34 Screenshot 2024-10-17 at 16 01 44
kimisgold commented 2 weeks ago

Bottom margin should be in now.

matthewjmckinley commented 2 weeks ago

@allanaaa is this now all set for final screenshots/documentation? I can package for release at your say so.

allanaaa commented 2 weeks ago

Were you not planning to fix this tree visual issue?

Screenshot 2024-10-22 at 10 13 48
allanaaa commented 2 weeks ago

The page block on Thanks Roy and Center Row:

Screenshot 2024-10-22 at 10 19 46 Screenshot 2024-10-22 at 10 19 53
kimisgold commented 2 weeks ago

I believe the collapsing tree issue should be fixed now. there was an extra closing </li>, and we also now have fallback grouping labels across the views.

matthewjmckinley commented 2 weeks ago

Thank you, Kim! Hopefully we are all set now 🤞

allanaaa commented 2 weeks ago

Papers is giving me some trouble:

http://dev.omeka.org/amayer/amayer-s/omeka-s/s/my-fifth-site/hierarchy/7

Screenshot 2024-10-22 at 13 48 08

Also, this grouping ("7") is saying it contains material from 2 item sets, but it's at the lowest level and only contains materials from 1 (National Mall Items). Or is that indicating the whole contents of the whole hierarchy, rather than each individual grouping?

matthewjmckinley commented 2 weeks ago

The 'Contains resources from' applies to the whole contents of the hierarchy it's positioned under.

kimisgold commented 2 weeks ago

I would say Papers is not a blocker here as it uses custom markup for the item browse. I'll file an issue for updating it separately.

matthewjmckinley commented 1 week ago

Are we good to go on this now? Any other blockers?

allanaaa commented 1 week ago

No problems that I can see. I've just updated the docs to include all the latest changes and fixes.

allanaaa commented 1 week ago

Do any themes need a new release to work with this?