Jump to content

Recommended Posts

Posted (edited)

For my app I never made a public page that lists content items for a specific node. I felt it didn't really need it and so I just listed all active content items together, regardless of node. So I commented out the various url properties in my node class, since there is nowhere for it to lead to, which would show a node's content items.

Well, now it's causing someone's sitemap task to have an exception thrown since that is what function url() in Model.php does, since I commented out my url properties.

So I guess I will have to add a page per node in? I just assumed that it wasn't a requirement to have per node content item listings. In this app, there's usually only 1 or 2 content items active at a time so seemed pointless to then make per node listings. I could have them all redirect to some generic page, but that would be odd. Can't the sitemap just link only to the main app page and leave it at that? But even then, maybe some other areas could get messed up from that same exfeption too.

Edited by Midnight Modding
Posted (edited)
7 hours ago, Adriano Faria said:

I have a version from IPS 4.2 from this: https://invisioncommunity.com/files/file/8859-staff-applications-system/

It used a dummy category. I don’t remember any issue related to sitemap. It won’t run in 4.7 obviously but you can take a look on its category model and public controller.

Let me know if you want to take a look. If so, I’ll send a link via message.

Well, when I run the generateSitemap task in the acp on my test site and on my live site it says it runs successfully. So I am starting to think if I change anything it won't fix whatever is causing that one person to get the error. But someone from IPS told him my app is what threw the exception and it is from function url(). Hard to do anything if I can't reproduce the issue.

edit: well it said ran successfully, but it output a blank line. When I updated the furl file and put the url properties back into the node file, it says successfully submitted to google. For now it goes to a nonexisting page, but I assume otherwise it fixed the problem.

Edited by Midnight Modding
Posted

You could implement your own url() method that doesn't reference those class properties but if you don't want it in a sitemap you can set the $includeInSitemap property to false. You may still have issues if something requires url() and those other properties though

Posted (edited)
1 hour ago, Stuart Silvester said:

You could implement your own url() method that doesn't reference those class properties but if you don't want it in a sitemap you can set the $includeInSitemap property to false. You may still have issues if something requires url() and those other properties though

Thanks. I just went ahead and made a category page listing the content items, rather than try to work around it.

Btw this is odd. Before adding it in, it simply gave an inline message in the acp saying task run successfully and returned a blank message below it. When I put the url properties back in, it did the same thing, except instead of the blank message, it said it was submitted to google. But after I got everything finished, it now gives a redirect message saying task run successfully instead of an inline message above the task manager. I wonder what happened? When it gave the inline one maybe there was still some sort of error?

Edited by Midnight Modding
Posted
46 minutes ago, Midnight Modding said:

Thanks. I just went ahead and made a category page listing the content items, rather than try to work around it.

Btw this is odd. Before adding it in, it simply gave an inline message in the acp saying task run successfully and returned a blank message below it. When I put the url properties back in, it did the same thing, except instead of the blank message, it said it was submitted to google. But after I got everything finished, it now gives a redirect message saying task run successfully instead of an inline message above the task manager. I wonder what happened? When it gave the inline one maybe there was still some sort of error?

The issue was rebuilding the sitemap from the sitemap page and then running the background queue.

Posted
3 hours ago, Stuart Silvester said:

The issue was rebuilding the sitemap from the sitemap page and then running the background queue.

It was affecting acp task manager behavior too, though.

Something must still be going on... When I look at the sitemaps on the front end on my live site and my test site, now they have some links for my app, but my test site is only showing the latest 1 category when I have 2 categories there. Then for the content item link, on my main site there IS no sitemap link for content items from my app and on my test site there is, but then it only shows 1 content item within that file, whereas there are probably 20 on the site.

I thought maybe it's only intentionally showing new ones, but I see for forums and topics it shows all, whether recently posted in or not.

My understanding was we only have to create an actual sitemap extension if we need to add things beyond what core will already pull from our apps, so I did not create one. So if the suite automatically pulls our nodes and content items, what could make it not be retrieving them all in my case? Do I need to create a sitemap extension even if I don't need any content added outside the automatic content?

Posted (edited)

I don't know what to think at this point. I am going through the suite files and I see in one place apparently it uses the databaseColumnMap field 'last_comment' to use as the latest update time. I did not set that field because I don't have commenting even set up. But also why would it still retrieve one row if not having that defined is the problem?

The forums app does not have its own sitemap extension and my contentRouter extension class is like the forums one, but for some reason mine is not adding all nodes or items to the sitemap like the forums one does. Also, my acp has no error logs at all, even before working on this.

edit: this is so frustrating. now for some reason my main site added the other content item into the sitemap. I also noticed my test site for some reason had view/read permissions for guests disabled in the second node. But now after I updated the permissions and rebuilt the sitemap in tasks over and over it's not adding to it still.

Edited by Midnight Modding
Posted (edited)

Just thought of something. On the test site I originally had read/view OFF for category 1 and ON for category 2. The only item in category 2 was id #10. So now in the db it has 10 as last id for that sitemap. So now that i fixed permissions in category 1, is it never going to add ids 1-9 because permissions weren't right at the time id 10 was added?

Edited by Midnight Modding
Posted (edited)

what a day... so at some point it did update the sitemaps. But, in the past something being run in the acp was generating links to acp pages and I had to change my function url() in my content item to sometimes return a public link instead. So now it did the opposite and did acp links in the sitemap!

I then commented out the lines in the function where it doesn't do that and eventually it updated them to the correct links now.

edit: lol.... apparently that function url() had to be changed in a private app I made before this public app and I just accidentally had it in my file for this app also. So i just took my function url() out totally on this one now.

So I think finally I got it all working... So I guess it doesn't have to have the latest comment time and it does overwrite every link each time because originally all of my links were acp ones and now they all changed to the proper front ones.

Edited by Midnight Modding
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...