Skip to content

51 serious plugin conflicts [IN PROGRESS]#58

Open
mai-tran-03 wants to merge 12 commits into
masterfrom
51-serious-plugin-conflicts
Open

51 serious plugin conflicts [IN PROGRESS]#58
mai-tran-03 wants to merge 12 commits into
masterfrom
51-serious-plugin-conflicts

Conversation

@mai-tran-03

Copy link
Copy Markdown

Fixing #51

  • Change most of the database name to add prefix {walking}
  • Fixing conflicting bugs coming up with name changes

@mai-tran-03 mai-tran-03 linked an issue May 28, 2026 that may be closed by this pull request
@mai-tran-03 mai-tran-03 marked this pull request as ready for review July 6, 2026 22:57
@mai-tran-03 mai-tran-03 requested a review from Copilot July 6, 2026 22:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses plugin conflicts with Tour Builder by namespacing the WalkingTour plugin’s database tables, routes, and model layer, and by updating admin/public UI code to match the renamed resources.

Changes:

  • Renames core records/tables from Tour/TourItem to WalkingTour/WalkingTourItem and adds upgrade-time migration to new prefixed table names.
  • Updates admin/public routes and templates to use walking-tours/* endpoints and walking_tour view variables.
  • Improves map UI robustness (guards around missing route/marker data) and adds an admin “live preview” refresh path.

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
WalkingTourPlugin.php Renames install/uninstall tables and adds upgrade migration into new walking_* tables.
routes.ini Moves admin routes under walking-tours/:action to avoid collisions.
plugin.ini Bumps plugin version.
controllers/ToursController.php Switches default model to WalkingTour.
controllers/IndexController.php Updates to WalkingTour tables and adds preview endpoint + query adjustments.
helpers/TourFunctions.php Renames helper functions and updates current-record accessors for walking tours.
models/WalkingTour.php Renames record class to WalkingTour and updates item linkage to WalkingTourItem.
models/WalkingTourItem.php Renames record class to WalkingTourItem and updates relations.
models/WalkingTourTable.php Renames table class and updates SQL to use walking_tour_items.
views/admin/tours/browse.php Updates browsing UI to use walking tour helpers/variables.
views/admin/tours/show.php Updates metadata access and variable names to walking_tour.
views/admin/tours/add.php Updates add form to use walking tour variables and formatting.
views/admin/tours/edit.php Updates edit page layout and fixes public map link building for walking tours.
views/admin/tours/form.php Renames form bindings/variables and switches admin preview JS include.
views/admin/javascripts/walking-tour-admin.js Adds admin live preview refresh and additional routing error handling.
views/admin/css/tour-1.7.css Reformats and adds layout styling for the updated admin form/sidebar.
views/public/index/index.php Updates public filter label text.
views/public/javascripts/walking-tour-public.js Adds guards and improves stability around marker/route parsing and bounds fitting.
views/public/css/walking-tour-public.css Adds/updates public map UI styling and component layout.
Comments suppressed due to low confidence (6)

models/WalkingTourItem.php:22

  • getItem() is fetching from the WalkingTourItem table using item_id, which will return the wrong record type (or null) and breaks the Item relation. It should fetch from the Item table by item_id.
    models/WalkingTourTable.php:56
  • Omeka_Db_Select_PublicPermissions::apply() is being called with the table alias 'tours', but this table is now walking_tours (and the select is ordered by walking_tours.id). Using the wrong alias can cause SQL errors or skip permission filtering.
    models/WalkingTourTable.php:44
  • findImageByTourId() builds a SQL query joining files f to walking_tour_items ti using ON i.id = ti.item_id, but the i alias is not defined in this query. This will fail at runtime if the method is called, and the join condition also doesn't appear to match the intent (files vs items).
    views/admin/javascripts/walking-tour-admin.js:252
  • refreshCurrentTourPreview() uses markerData[currentTour] before markerData is guaranteed to be initialized (it is only populated later by doQuery()'s AJAX response). If the user edits tour items before markerData is set, this will throw a TypeError.
    views/admin/javascripts/walking-tour-admin.js:312
  • The marker icon HTML closes with </spam> instead of </span>, which results in invalid markup and can break the custom marker rendering in some browsers.
    views/admin/javascripts/walking-tour-admin.js:343
  • The OpenRouteService API key is embedded directly in client-side JavaScript (Authorization: ...). This exposes the key to anyone who can load the admin page (and the same key also appears elsewhere in this repo), which can lead to key theft/abuse and unexpected billing/rate-limiting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread views/admin/tours/form.php
Comment thread controllers/IndexController.php
@mai-tran-03 mai-tran-03 mentioned this pull request Jul 6, 2026
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

Successfully merging this pull request may close these issues.

Serious Plugin Conflicts

2 participants