Posts

Koha commands to check and fix all the biblio records automagically

Prepare system first:  export PERL5LIB="/usr/share/koha/lib" export KOHA_CONF="/etc/koha/sites/library/koha-conf.xml" Run:  /usr/share/koha/bin/maintenance/touch_all_biblios.pl -v Seat back and watch the output till  the end when you will see:  Touched biblio 25818 Good: 25092, Bad: 108 (of 25200) in 489 seconds Accuracy: 99.57% Average time per record: 0.019405 seconds

Necessary Debian Administration commands

 Cache server cache: Problem: Failed to flush caches: Unit dbus-org.freedesktop.resolve1.service not found. Solution:  Enable the systemd-resolve service systemd-resolve --flush-caches

Install git CLI gh commands in debian

Reference: https://github.com/cli/cli/blob/trunk/docs/install_linux.md https://github.com/cli/cli/releases wget https://github.com/cli/cli/releases/download/v2.12.1/gh_2.12.1_linux_amd64.deb dpkg -i gh_2.12.1_linux_amd64.deb apt -f install

Drupal Insert into new content type date only field from existing timestamp

CODE:  INSERT INTO node__field_date (entity_id, bundle, revision_id, langcode, field_date_value) SELECT nid, type, vid, langcode, FROM_UNIXTIME(created, '%Y-%m-%d') FROM node_field_data  Table comparison: node__field_data = node__field_date nid = entity_id type = bundle vid = revision_id langcode = langcode created = field_date_value Sample data: bundle:newsclips:type entity_id:123670 revision_id:123785 langcode:en field_date_value:2022-06-13

Print Taxonomy Term Url with list

  {% for item in node . field_category %} <a href = "{{ path( 'entity.taxonomy_term.canonical' , { 'taxonomy_term' : item . entity . tid . value }) }}" > {{ item . entity . name . value }} </a> {% endfor %} Reference: https://www.drupal.org/forum/support/post-installation/2016-04-19/getting-url-of-taxonomy-term-page-from-twig-template

Add jQuery Date picker with month and year selection and a fix starting date

Image
  Today, I have learned how to add a jQuery date picker in Drupal 9 theme. I am going to share the steps and codes here.  Steps:  1. Add jquery library to your drupal 9 theme 2. Create a jquery file for  jQuery date picker 3. Apply custom css code to customized your needs. 4. Attach library to theme file 5. Add the date picker to bootstrap 5 form Dependencies:  jQuery jQuery Date Picker JavaScript Bootstrap 5 Drupal 9 Step 1:  Attach files to the theme's library for Drupal: Open your themes libraries.yml file and put the following code:  datepicker :   version : VERSION   css :       theme :         assets/custom/datepicker/datepicker.css : {}   js :       //code.jquery.com/jquery-3.6.0.js : { type : external }       //code.jquery.com/ui/1.13.1/jquery-ui.js : { type : external }       assets/custom/datepicker/datepicker.js : {} Step 2:  Create a JavaScript file as linked in libraries: ( assets/custom/datepicker/datepicker.js) and put the following jQuery codes: $ ( function () {

Enable Remote Access to mysql

  GRANT SELECT ON koha_ils.* TO libinout@'118.179.175.123' IDENTIFIED BY 'passwd';