---
name: evolution-pipe-modifier-cat-scope
description: "Pipe modifier getPipeFull is scoped by the source item's own category, so full lengths vanish if the source item sits outside cat 10/24"
metadata: 
  node_type: memory
  type: project
  originSessionId: 7d2abb8b-b28b-4551-865f-7446ee62eaf5
  modified: 2026-07-29T03:08:42.836Z
---

`plugins/pipe/pipetopostsave.php::getPipeFull` filters full-length pipe by `inventory.cat='$_REQUEST[cat]'`, and `pipetopost2.js` sends the **source item's own** `data-cat` (populated from `inventory.cat` by `app/ajax/selectFilter.js`). Commit `1ae03b489` (18 Apr 2023) replaced the original hardcoded `(cat='$pipeCat' OR cat='$shsCat')` — i.e. 10 + 24 — with that request value. `$pipeCat`/`$shsCat` are still declared but dead.

**Data convention (Otter Fencing, tenant `108-1481181613`):** full-length raw stock lives ONLY in cat **10 (CHS Pipe)** and cat **24 (SHS & RHS Tube)**. Source/post items live in cat 44 (Chain-link Posts), 47 (Tubular Posts), 45 (U-Tunnel Posts) and carry `length` 1000 or 60 — never >1000, which the query requires.

**Why:** picking any post-category source silently returns `[]` — empty dropdown, no error. The same edit broke the supplier-`$codes` query in that handler. Reported 2026-07-29 for `PMG50` after the client re-categorised it out of cat 10; resolved by moving the item back, NOT by a code fix, so the fragility is still live.

**How to apply:** if "pipe modifier shows no full lengths" recurs, check the source item's `cat` before anything else. Real fix = restore the 10+24 scope on both queries and drop `&cat=` from the JS. Same file also interpolates `$_REQUEST` raw into SQL (injection) and gates only on `checkSession()` with no `mod_inv` check — see [[evolution_ajax_save_auth_gate]] and [[evolution_getfieldarray_deprecated]].
