Giter Club home page Giter Club logo

citation_select's People

Contributors

hyphenhook avatar jeffbuyunhe avatar kylehuynh205 avatar larkgz avatar natkeeran avatar rosiel avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

rosiel

citation_select's Issues

Citation copies unnecessary text

Issue: Copying the citation of an object copies additional note that should not be copied
Desired: Only the citation is copied.

Example:

  • Reproduce issue on any of the public sites (e.g. doris, menus, tamil):
    • Click "Browse Collection" > Click on any object
    • Navigate to "Cite This Object" > select a citation format > copy citation > copies all text (the citation provided + phrase: "Review all citations for accuracy.")
    • e.g. this is what copied to clipboard: McCarthy, D. Late Light and Pyramid Mountains [Paintings (visual works)]. (Original work published 1982) Review all citations for accuracy.
Screenshot 2024-03-07 at 2 22 11 PM

Explore option to replace bibcite dependency

Currently bibcite is being used to generate the citation.

Bibcite is a large drupal module that does several things. We use it a limited way to generate the citation. We would like to explore the option of removing the bibcite dependency.

  • Look into how bibcite is being used. What are some alternative libraries that can be used?

  • Look into how Citation Formatters work?

  • Explore how admin/config/bibcite options are being used, and how they can be alternatively provided (will need to provide that through citation_select) module

  • Provide a scope in terms of (days) for the above work

When date field has date range, the citation is not generated

https://menus.digital.utsc.utoronto.ca/61220/utsc41580

https://git.drupalcode.org/project/citation_select (beta5)

Error: Call to undefined method EDTF\Model\Interval::getYear() in Drupal\citation_select\Plugin\CitationFieldFormatter\EdtfDateFormatter->parseDate() (line 33 of /var/www/D10-menus/web/modules/contrib/citation_select/src/Plugin/CitationFieldFormatter/EdtfDateFormatter.php)

#0 /var/www/D10-menus/web/modules/contrib/citation_select/src/CitationFieldFormatterBase.php(27): Drupal\citation_select\Plugin\CitationFieldFormatter\EdtfDateFormatter->parseDate()
#1 /var/www/D10-menus/web/modules/contrib/citation_select/src/CitationProcessorService.php(96): Drupal\citation_select\CitationFieldFormatterBase->formatMultiple()
#2 /var/www/D10-menus/web/modules/contrib/citation_select/src/Form/SelectCitationForm.php(160): Drupal\citation_select\CitationProcessorService->getCitationArray()
#3 [internal function]: Drupal\citation_select\Form\SelectCitationForm->getBibliography()
#4 /var/www/D10-menus/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array()
#5 /var/www/D10-menus/web/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(109): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse()
#6 [internal function]: Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException()
#7 /var/www/D10-menus/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#8 /var/www/D10-menus/vendor/symfony/http-kernel/HttpKernel.php(239): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#9 /var/www/D10-menus/vendor/symfony/http-kernel/HttpKernel.php(91): Symfony\Component\HttpKernel\HttpKernel->handleThrowable()
#10 /var/www/D10-menus/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#11 /var/www/D10-menus/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#12 /var/www/D10-menus/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#13 /var/www/D10-menus/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#14 /var/www/D10-menus/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#15 /var/www/D10-menus/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#16 /var/www/D10-menus/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#17 /var/www/D10-menus/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#18 /var/www/D10-menus/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#19 {main}

UX Changes

  • Remove labels
  • Add "Select a citation format" to dropdown
  • Trigger when an option is selected rather than when a button is pressed
  • Switch button to copy text instead of generate citations

Deprication function with PHP 8.1

To reproduce:

Message Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Seboettg\CiteProc\Util\StringHelper::removeBrackets() (line 315 of /var/www/drupal/vendor/seboettg/citeproc-php/src/Util/StringHelper.php)
#0 /var/www/drupal/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 /var/www/drupal/vendor/seboettg/citeproc-php/src/Util/StringHelper.php(315): str_replace()
#3 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Date/Date.php(375): Seboettg\CiteProc\Util\StringHelper::removeBrackets()
#4 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Date/Date.php(216): Seboettg\CiteProc\Rendering\Date\Date->cleanDate()
#5 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Date/Date.php(165): Seboettg\CiteProc\Rendering\Date\Date->createDateTime()
#6 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Group.php(113): Seboettg\CiteProc\Rendering\Date\Date->render()
#7 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Choose/ChooseIf.php(79): Seboettg\CiteProc\Rendering\Group->render()
#8 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Choose/Choose.php(98): Seboettg\CiteProc\Rendering\Choose\ChooseIf->render()
#9 /var/www/drupal/vendor/seboettg/citeproc-php/src/Style/Macro.php(86): Seboettg\CiteProc\Rendering\Choose\Choose->render()
#10 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Text.php(290): Seboettg\CiteProc\Style\Macro->render()
#11 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Text.php(120): Seboettg\CiteProc\Rendering\Text->renderMacro()
#12 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Choose/ChooseIf.php(79): Seboettg\CiteProc\Rendering\Text->render()
#13 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Choose/Choose.php(105): Seboettg\CiteProc\Rendering\Choose\ChooseIf->render()
#14 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Group.php(113): Seboettg\CiteProc\Rendering\Choose\Choose->render()
#15 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Group.php(113): Seboettg\CiteProc\Rendering\Group->render()
#16 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Layout.php(130): Seboettg\CiteProc\Rendering\Group->render()
#17 /var/www/drupal/vendor/seboettg/citeproc-php/src/Rendering/Layout.php(97): Seboettg\CiteProc\Rendering\Layout->renderSingle()
#18 /var/www/drupal/vendor/seboettg/citeproc-php/src/Style/Bibliography.php(76): Seboettg\CiteProc\Rendering\Layout->render()
#19 /var/www/drupal/vendor/seboettg/citeproc-php/src/CiteProc.php(137): Seboettg\CiteProc\Style\Bibliography->render()
#20 /var/www/drupal/vendor/seboettg/citeproc-php/src/CiteProc.php(183): Seboettg\CiteProc\CiteProc->bibliography()
#21 /var/www/drupal/web/modules/contrib/bibcite/src/Plugin/BibCiteProcessor/CiteprocPhp.php(67): Seboettg\CiteProc\CiteProc->render()
#22 /var/www/drupal/web/modules/contrib/bibcite/src/CitationStyler.php(92): Drupal\bibcite\Plugin\BibCiteProcessor\CiteprocPhp->render()
#23 /var/www/drupal/web/modules/contrib/citation_select/src/Form/SelectCitationForm.php(163): Drupal\bibcite\CitationStyler->render()
#24 [internal function]: Drupal\citation_select\Form\SelectCitationForm->getBibliography()
#25 /var/www/drupal/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array()
#26 /var/www/drupal/web/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(109): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse()
#27 [internal function]: Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException()
#28 /var/www/drupal/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#29 /var/www/drupal/vendor/symfony/http-kernel/HttpKernel.php(229): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#30 /var/www/drupal/vendor/symfony/http-kernel/HttpKernel.php(92): Symfony\Component\HttpKernel\HttpKernel->handleThrowable()
#31 /var/www/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#32 /var/www/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#33 /var/www/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#34 /var/www/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#35 /var/www/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#36 /var/www/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#37 /var/www/drupal/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#38 /var/www/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
#39 /var/www/drupal/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#40 {main}

Goal

  • Troubleshoot and find the fix.
  • If not, Find the fix online ?
  • If not, find or create patch to fix that Deprecated error.

Run test cases for new updates

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.