This may sound like a basic question, but is it possible that there isn't a value for $rowId when $requestUrl is assigned? If $rowId were null, that would explain the error. To help me troubleshoot, could you try logging the value of $requestUrl right after you assign it?