Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Fix algolia index title refer #2125

Merged
merged 3 commits into from
Sep 1, 2023
Merged

Conversation

angelinekwan
Copy link
Collaborator

@angelinekwan angelinekwan commented Aug 31, 2023

What changed, and why it matters

Noticed that since last week, the Git workflow to push page updates to Algolia index (for search) fails due to error in title
Workflow failed example

Screenshot 2023-08-31 at 16 25 59

Solution

The error message "UnboundLocalError: local variable 'title' referenced before assignment" suggests that the variable title is being used before it has been assigned any value.

To fix this:

  1. Initialize variables like title to default value <title>
  2. Check if elements exist before extracting content from it.

To test the workflow

Temporary set if changes happens to this branch fix-algolia-index-title-refer, execute the workflow and it runs successfully.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 31, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: db1c4ae
Status: ✅  Deploy successful!
Preview URL: https://1529012d.devportal.pages.dev
Branch Preview URL: https://fix-algolia-index-title-refe.devportal.pages.dev

View logs

@angelinekwan angelinekwan marked this pull request as ready for review August 31, 2023 13:44
@angelinekwan angelinekwan merged commit b75656e into main Sep 1, 2023
5 checks passed
@angelinekwan angelinekwan deleted the fix-algolia-index-title-refer branch September 1, 2023 08:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants