• This is totally puzzling. Here is the background:
    1) Woo Listings Theme with Custom Post types & fields
    2) Custom template to list posts eligible for update by signed in user
    3) Custom template to edit eligible posts for signed in user called by form submit passing post id

    The relevant code for template in item 2

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    The problem:
    When I remark out these three lines:

    print('<pre>');
    print_r($_POST);
    print('</pre>');

    clicking the edit button from item 2 appends the url of the source page to the destination page and comes back with a 404.

    I just can’t work out why it functions with the debugging code and fails without it. Any help will be greatly appreciated, and thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Marj Wyatt

    (@marjwyatt)

    I see that the code was removed from my post because I didn’t realize that the rules had changed.

    Here is pastebin link for relevant code in item 2:
    http://pastebin.com/wVb0M2km

    Here is template code called by item 2
    http://pastebin.com/m73LXuuG

    Even revising the print_r code to output to a variable, removing the echo of that variable caused the click to append the url of the originating page to the actual destination page and throws a 404.

    Thread Starter Marj Wyatt

    (@marjwyatt)

    It seems that the problem was caused by the redirect statement in the code. First off, the way that the redirect is called was not an absolute path, which is what I learned that function for redirecting required. I finally removed the redirect in the template because printing debugging content forced it to stay on the page.

    I don’t know if we need to keep this open but I will continue to report back here as things progress.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Code only works with debugging enabled?’ is closed to new replies.