Skip to content

Commit

Permalink
Be use to include the element table where required.
Browse files Browse the repository at this point in the history
reported by: Frank S

: ERROR: invalid reference to FROM-clause entry for table "element" LINE 71: ...arterlyBranch(ports.id, categories.name || '/' || element.na... ^ HINT: There is an entry for table "element", but it cannot be referenced from this part of the query.
  • Loading branch information
dlangille committed May 25, 2019
1 parent f0220c9 commit cf6f125
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions classes/ports.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ function FetchByElementID($element_id, $UserID = 0) {
ports.conflicts_install,
to_char(ports.date_added - SystemTimeAdjust(), 'DD Mon YYYY HH24:MI:SS') as date_added,
ports.categories as categories,
element.name as port,
categories.name as category,
element.name as port,
categories.name as category,
ports_vulnerable.current as vulnerable_current,
ports_vulnerable.past as vulnerable_past,
array_to_json(regexp_match(pkg_plist, 'lib/[[:alpha:]]*?\.so')) AS pkg_plist_libray_matches,
Expand Down Expand Up @@ -542,11 +542,12 @@ function FetchByCategoryInitialise($CategoryName, $UserID = 0, $PageSize = 0, $P
PortVersionOnQuarterlyBranch(ports.id, categories.name || '/' || element.name) AS quarterly_revision
FROM ports_vulnerable right outer join ports on (ports_vulnerable.port_id = ports.id),
categories, ports_categories, categories PRIMARY_CATEGORY
categories, ports_categories, categories PRIMARY_CATEGORY, element
WHERE ports_categories.port_id = ports.id
AND ports_categories.category_id = categories.id
AND categories.name = '" . pg_escape_string($CategoryName) . "'
AND PRIMARY_CATEGORY.id = ports.category_id ) AS P
AND PRIMARY_CATEGORY.id = ports.category_id
AND ports.element_id = element.id ) AS P
ON (P.element_id = element.id
AND element.status = 'A') JOIN element_pathname EP ON P.element_id = EP.element_id AND EP.pathname like '/ports/";

Expand Down

0 comments on commit cf6f125

Please sign in to comment.