3

I have this code right here :

<td class="nowrap has-context">
        <a href="<?php 
    echo JRoute::_('index.php option=com_subscription&task=subscriptionsform.edit&reportId='.$this->escape($item['id'])); ?>">
            <?php echo $this->escape($item['title']); ?>
            </td>   

I am trying to pass the variable reportId in my Edit view but when I click the link, the reportId is not found. Are there any restrictions in passing variables to the edit form? is it only restricted on an Item's Id which is the default?

http://localhost/bdes3/index.php/component/subscription/subscriptionsform?layout=edit

it always redirects to this link. When I removed
$controller->redirect(); in my main controller, the reportId was included in the URL but the edit fields were gone.

  • What do you get if you echo $this->escape($item['id']); ? Does the ID actually appear? – Lodder Dec 8 '14 at 1:03
  • When I include the Id as a column in the list, the Id appears correct. It's when I pass it as a parameter to the edit view that it disappears. – Break the Law Dec 8 '14 at 1:15
  • Try checking your controller for a function called edit...you might find a redirect occurring there. – GDP Dec 8 '14 at 1:20
  • GDP it worked but unfortunately the edit form fields was gone. it only displayed a blank page. – Break the Law Dec 8 '14 at 1:23
  • Not sure what "worked", but if a redirect is there, it may not be including your reportId, thus not appearing where you would expect. I don't know the component, so can't guide you any further other than that hint/suggestion. – GDP Dec 8 '14 at 1:35
2

Honest mistake. I was editing the wrong controller file. It should be the controller/subscriptionsform.php not subscriptions.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.