ynorth-projects / openy_repeat Goto Github PK
View Code? Open in Web Editor NEWDecouple openy_repeat.
Decouple openy_repeat.
Drupal allows empty links to be made with <nolink>
or <none>
in the link field URI text. We should handle this, otherwise the url appears as href="route:<nolink>"
.
In some situations, the Schedule pages stop working after the initial load and change in filters/date. The application simply freezes and there is an error in the console.
The cause of the issue relates to the key
attribute of v-for
constructions.
Whenever a v-for
construction is used with the key
attribute the attribute values must be unique (see https://vuejs.org/v2/guide/list.html#Maintaining-State).
The openy_repeat
module does have at least one v-for
construction with the key
attribute
https://github.com/ynorth-projects/openy_repeat/blob/9.x-2.x/templates/openy-repeat-schedule-dashboard--table.html.twig#L36
The values used as keys are not guaranteed to be unique in this situation as Node IDs of session nodes are used. In order to reproduce the non-unique keys, just add a couple of session time paragraphs that will schedule that event more than once a day.
For production, the module uses the production build of the Vue.js (see https://github.com/ymcatwincities/openy/blob/9.x-2.x/modules/custom/openy_system/openy_system.libraries.yml#L14). The production build suppresses all the warnings.
The non-minified (non-production) build of the Vue.js (https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue.js) will show warnings:
For large schedules (with more than a single page of content a day), the error might occur:
Production | Non-prouduction Vue.js |
---|---|
![]() |
![]() |
Interestingly, the issue is not reproduced in the Carnation. That's because the template is overridden ๐คฆ :
https://github.com/ymcatwincities/openy/blob/9.x-2.x/themes/openy_themes/openy_carnation/templates/openy_repeat/openy-repeat-schedule-dashboard--table.html.twig#L36
The key
attribute is removed in that override.
The solution.
Technically, removing the key
attribute should work just fine.
Error messages:
TypeError: Cannot read properties of undefined (reading 'key') vue.min.js:6
at ir (vue.min.js:6)
at vue.min.js:6
at x (vue.min.js:6)
at vue.min.js:6
at x (vue.min.js:6)
at a.__patch__ (vue.min.js:6)
at a.e._update (vue.min.js:6)
at a.r (vue.min.js:6)
at fn.get (vue.min.js:6)
at fn.run (vue.min.js:6)
[Vue warn]: Error in nextTick: "TypeError: Cannot read properties of undefined (reading 'key')"
warn @ vue.js:634
TypeError: Cannot read properties of undefined (reading 'key')
at sameVnode (vue.js:5818)
at updateChildren (vue.js:6220)
at patchVnode (vue.js:6320)
at updateChildren (vue.js:6194)
at patchVnode (vue.js:6320)
at VueComponent.patch [as __patch__] (vue.js:6481)
at VueComponent.Vue._update (vue.js:3949)
at VueComponent.updateComponent (vue.js:4067)
at Watcher.get (vue.js:4478)
at Watcher.run (vue.js:4553)
When the openy_repeat paragraphs are loading for the first time, the OpenyRepeatRepository::getLocations()
method tends to get most session nodes loaded. This makes the entity memory cache service consume quite some memory, in our case, more than 256 MB.
See
openy_repeat/src/OpenyRepeatRepository.php
Line 122 in 928a661
Steps to Reproduce:
Result:
Popup is placed at the bottom of the screen
Make location pre-selected on the sidebar filter according to the Preferred Branch selection.
In the distribution, we have a "set preferred branch" functionality. When the user has already set their branch we will use this default value in the location filter.
Ideally, we would like this to be a flag that can be turned on/off in the Repeat Schedules paragraph so it doesn't affect functionality on the current Ys.
Hi,
I started using this module on a site that has existing programs, program subcategories and activities, but that wasn't using classes and sessions. When trying to update existing activities I'm getting a fatal error.
The website encountered an unexpected error. Please try again later.
Drupal\Core\Entity\EntityStorageException: Query condition 'node__field_session_class.field_session_class_target_id IN ()' cannot be empty. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 815 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Database\Query\Select->condition('node__field_session_class.field_session_class_target_id', Array, 'IN') (Line: 77)
Drupal\Core\Entity\Query\Sql\Condition->compile(Object) (Line: 177)
Drupal\Core\Entity\Query\Sql\Query->compile() (Line: 81)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 105)
openy_repeat_nodes_actualize_sessions(Object) (Line: 37)
openy_repeat_nodes_entity_update(Object)
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'openy_repeat_nodes') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_update', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_update', Array) (Line: 217)
Drupal\Core\Entity\EntityStorageBase->invokeHook('update', Object) (Line: 900)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('update', Object) (Line: 564)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, 1) (Line: 781)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, 1) (Line: 489)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 804)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 339)
Drupal\Core\Entity\EntityBase->save() (Line: 270)
Drupal\node\NodeForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('node_activity_edit_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 58)
Drupal\openy_block_date\StackMiddleware\BlockDateCacheInvalidator->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 692)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Hi, thanks for the hard work on this module!
We had a user tell us that they tried downloading a particular event for their calendar, but the downloaded file referenced a different event. After some trial and error I was able to reproduce it by filtering on location without reloading the page. Just to check whether it was an issue local to our site I tried to see if I could reproduce it on the Greensboro site, and I could.
title
is Open%20Gym
)It should be the same calendar link
https://addtocalendar.com/atc/ical?utz=60&uln=en-US&vjs=1.5&e[0][date_start]=2024-06-3%2005%3A00%3A00&e[0][date_end]=2024-06-3%2015%3A00%3A00&e[0][timezone]=America%2FNew_York&e[0][title]=Pickleball&e[0][description]=&e[0][location]=&e[0][organizer]=
(note the title
is Pickeball
)
It looks like that's the link to the first item when you first loaded the page (ie before applying the filter). If you reload the page with the filter it works fine.
We observed a JavaScript error on the schedule application page, which is visible in the console
Needs to update script according to this instruction https://www.drupal.org/node/3158256
The Repeat Schedules doesn't work when we place it via Layout Builder.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.