Fix basePath undefined error for local temp file parsing
Define basePath before Toast parsing block so image URLs can be properly constructed for local file uploads. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
d8e6f619ac
commit
c5b678ac05
1 changed files with 7 additions and 0 deletions
|
|
@ -68,6 +68,13 @@
|
|||
<cfset playwrightImages = arrayNew(1)>
|
||||
<cfset arrayAppend(response.steps, "Read " & len(pageHtml) & " bytes from local file")>
|
||||
|
||||
<!--- Extract base path for local files (relative to the HTML file) --->
|
||||
<cfset localDir = getDirectoryFromPath(localFilePath)>
|
||||
<cfset basePath = reReplaceNoCase(targetUrl, "/[^/]*$", "/")>
|
||||
<cfif NOT reFindNoCase("/$", basePath)>
|
||||
<cfset basePath = basePath & "/">
|
||||
</cfif>
|
||||
|
||||
<!--- Check for Toast menu page - extract from visible HTML for most complete data --->
|
||||
<cfif findNoCase("class=""headerText""", pageHtml) AND findNoCase("toasttab", pageHtml)>
|
||||
<cfset arrayAppend(response.steps, "Toast menu detected - parsing visible HTML items")>
|
||||
|
|
|
|||
Reference in a new issue