New Module Page Not Found

nate
@nate
10 years ago
917 posts
I have a new module that's basically a copy of the blogs module. When I click the link to go to the item detail page, I get "page not found".

Am I missing something? Again, I copied the blogs module and made it xtJobs. Went through each file and renamed everything.
updated by @nate: 06/19/15 05:44:35PM
michael
@michael
10 years ago
7,791 posts
hard to guess at, first guess is: does that user have permission to create the xtjobs? If a module is not set via a quota to be allowed that module on their profile, it would thow a 404 for the details page.

Sounds like the user is able to create the entry. Sounds like the user's created entry IS showing up in lists on their profile, but JUST the details page is in-accessable?

Check the URL is correct, make sure the
site.com/admin/blog/1/welcome-to-jamroom
site.com/(PROFILE)/(MODULE URL)/(ITEM ID)/(TITLE)

Is correct, could be that the link pointing to it is pointing to the wrong location.

--
after that I would start poking around in:
/module/(your module)/profile.php
profile_view_(your module)_default() function to see what variables are arriving if any.

--
(probably not, but..) make sure the sure the spelling of the filename for item_detail.tpl is correct:
/modules/(YOUR MODULE)/templates/item_detail.tpl

I've sometimes called it item_details.tpl by mistake.

--edit--
(long shot..) make sure you've run the integrity check so the datastore has been created.
updated by @michael: 05/18/15 06:47:48PM
nate
@nate
10 years ago
917 posts
Yes I can create and see it in a list. Integrity check ran. I will check the profile.php
michael
@michael
10 years ago
7,791 posts
If profile.php defaul() function returns FALSE then this flow occurrs in jrProfile/include.php:
 $_it = jrCore_db_get_item($mod, $_post['_1']);
            if (!isset($_it) || !is_array($_it)) {
                // Redirect to module index for this profile
                jrCore_location("{$_conf['jrCore_base_url']}/{$_rt['profile_url']}/{$_post['option']}");
            }
            // Make sure the item belongs to the profile
            if (isset($_it['_profile_id']) && $_rt['_profile_id'] != $_it['_profile_id']) {
                jrCore_page_not_found();
            }
            // Lastly - check to see if this item is pending approval.  If it is, only
            // admins and the profile owner(s) can view it
            $pfx = jrCore_db_get_prefix($mod);
            if (isset($_it["{$pfx}_pending"]) && $_it["{$pfx}_pending"] == '1') {
                if (!jrProfile_is_profile_owner($_it['_profile_id'])) {
                    jrCore_page_not_found();
                }
            }
            $dir = $mod;

            // Send our item_detail trigger
            $_ag = array(
                'module' => $mod
            );
            $_it = jrCore_trigger_event('jrProfile', 'item_detail_view', $_it, $_ag);

* the item is got
* make sure there it exists
* make sure the location the item is trying to be shown on is the owner of the profiles.

eg:
site.com/admin/blog/1/welcome-to-jamroom shouldnt show on
site.com/nate/blog/1/welcome-to-jamroom because the owner is /admin/

* see if it is still pending

and if it passes all that then it should show.

Tags