Closed (fixed)
Project:
XML sitemap
Version:
6.x-1.x-dev
Component:
xmlsitemap_node.module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Feb 2009 at 12:55 UTC
Updated:
22 Sep 2011 at 12:40 UTC
Jump to comment: Most recent
Comments
Comment #1
avpadernoxmlsitemap_update_sitemap()is defined in xmlsitemap.module, on line 434.As xmlsitemap.module is always loaded from Drupal (because the presence of
hook_exit()), and as cron.php always does a full Drupal bootstrap (it executes a call todrupal_bootstrap(DRUPAL_BOOTSTRAP_FULL)), you should not receive such error message.Check that the project files are intact, and are all updated to the latest version.
xmlsitemap.module has been moved to a sub-directory of xmlsitemap; therefore, you now find it in the xmlsitemap/xmlsitemap directory.
Comment #2
avpadernoI also find strange that you get an error about a not defined function being called from a
hook_nodeapi()implementation at cron time.At line 157 of xmlsitemap_node.module there is the
xmlsitemap_node_nodeapi()function, which should not normally be called during the execution of cron maintenance tasks (correct me if I am wrong).Comment #3
avpadernoComment #4
smulkey commentedI am having this same issue using the DRUPAL-6--2 version of xmlsitemap and calling update.php on upgrade from 5.x. Should the function be declared at the same file position in that branch?
Here is the code I see starting at line 434 in xmlsitemap.module:
Thanks for your help.
-Shawn
Comment #5
avpadernoThe position of the function in the file is not something important; PHP uses the function wherever the function is placed in the file. You can move the function inside that file, and PHP will always find it.
Comment #6
smulkey commentedYes, I bypassed the install error by adding an empty function of the same name but the root problem continues to be that this function doesn't appear defined anywhere in the DRUPAL-6--2 tag of the xmlsitemap module. In mentioning the file position, I was more looking to verify that I had right version of the module as a whole although I downloaded the code direcly from CVS so I'm relatively confident that I have the correct version.
Do you have any thoughts as to why this function would appear to be missing in the 6--2 branch (or the original branch referred to in this posting)?
Thanks for your help.
Comment #7
avpadernoThe DRUPAL-6--2 branch doesn't have any public release associated, and it should not used as it is code still being implemented. It exists only in the CVS because is not thought to be used on ANY site; it's not even ready for testing.
Comment #8
avpadernoThe function is declared, as I already replied, and as you can see it's present in CVS.
The module has been moved from modules/xmlsitemap/xmlsitemap.module to modules/xmlsitemap/xmlsitemap/xmlsitemap.module (the path is relative to the archive root folder).
The function exist from before I started to co-maintain the project modules, and I have never removed it.
Comment #9
avpadernoThis is very similar to what somebody else reported about a different function; in both the cases, the error should not be given, as the function exists, and it's defined in a file that is loaded from Drupal (or from the module needing it).
If anybody can explain why this happens, I will be thankful for the help given with this kind of issues.
Comment #10
kong commentedJust as Kiam suggested, the XML Sitemap module was moved to a sub directory. If you have installed the module prior to this change, the path to the module in
systemtable will be no longer valid.One solution is to disable every modules in XML Sitemap group, then reload the module page, and re-enable the modules again. If that's still not do the trick,try uninstalling and reinstalling the modules.Edited:
Actually you have to uninstall the module from Drupal and also delete the directory because if you just copied over the xmlsitemap directory then there will be two
xmlsitemap.modulefiles -- in thesites/all/modules/xmlsitemap/xmlsitemap.moduleandsites/all/modules/xmlsitemap/xmlsitemap/xmlsitemap.moduleand I think Drupal will just pick the first file instead of the one in xmlsitemap sub directory.Comment #11
avpadernoThanks, kong; what you said gave me an idea about a workaround I could implement when I move a file to a different directory.
I don't know how to exactly implement it (if I would directly change the Drupal core table, or to use a Drupal function), but maybe I could update the path saved in the Drupal core table, and be sure it is correctly updated (or be sure Drupal doesn't use the value it stored in cache).
Thanks again.
Comment #12
smulkey commentedThanks both Kiam and Kong.
I understand what is going on now and should be able to get past the issue we were having.
Regards.
-Shawn
Comment #13
avpadernoThis should be fixed as result of splitting the code into two different modules.
The code has been changed, and submitted to CVS.
Feel free to reopen the report if you still have the problem.
Comment #15
tahiticlic commentedThis function is not present in the 6.x-1.0-beta6 version.
This is not very important if you don't have xmlsitemap_term enabled, cause it's deprecated and replaced by xmlsitemap_taxonomy, but if you do the update process ends on an error, and more important, you can't disable xmlsitemap_term.
Adding it manually works.
Comment #16
dave reid@cfab I think you probably have some old module code somewhere. Try deleting the module folder and redownloading & extracting the beta6.
There is no call to xmlsitemap_update_sitemap() in the 6.x-1.x-beta6 or 6.x-1.x-dev code.
Comment #17
tahiticlic commentedYou're right and, as I wrote just above, that is the problem if you still have the deprecated xmlsitemap_term module.
I don't have problem here, I only give an explanation of this error, related to xmlsitemap_term module. By the way, when you do an update, it's always from an old module...
Comment #18
dave reid@cfab It's always best practice when updating/upgrading your modules, that you delete the old files then copy over the new module files so that old files aren't left over. You should always be doing the same thing when you update Drupal core. See the comments on the updating modules handbook page at http://drupal.org/node/250790.
Marking this issue back as fixed just incase others need to find this information.
Comment #19
kenorb commentedI get into the same problem as in this thread.
It's good practice to remove all files before you update it when you are working on non-repository file sources.
If you have something under version, you can't just remove all files and add them again, it will cause a conflict and other svn issues.
So you need to remove it via SVN delete command, but first you need to know which files do you want to remove.
In this case, sorry, but I don't know which files should I remove:
Is good to inform users on update that some files has been removed and could cause conflict.
Comment #20
kenorb commentedOk, I found.
svn del xmlsitemap_term
Thanks.
UPDATE:
Duplicate of this: #340743: Call to undefined function xmlsitemap_update_sitemap()
Comment #21
kenorb commentedIt's very bad programming to put the same names of function in different modules and copy them over and over again.
In this case my whole update process failed.
Comment #22
avpadernoWhich function has been placed in different modules, exactly?
Comment #23
dave reidWe have tried to make it clear in the module's included documentation and in the release notes for every release that you should not be copying over the new files. You have to clear out the old ones first. This is a standard that should be done every time you update a module, but in reality, most people don't. And it can lead to problems with stale, abandoned files.
Comment #24
kenorb commentedSorry, I though that xmlsitemap_update_sitemap() was defined twice, but it was undefined.
In my opinion update process should then disable xmlsitemap_term module which was abandoned in hook_update
Comment #25
avpadernoI think that is already done.
Comment #26
kenorb commentedhmm, nice.
So it's weird that it broke with this code during update.php
Maybe after disable it was still in memory somehow.
I'll not check it anymore, anyway, many thanks for help.
Comment #27
Anonymous (not verified) commentedThen you need to change your practice of how you implement the SVN imports and use a ``diff -upN'' between the new module and your existing working store. Then apply the difference to your SVN (yes you may need to manually add or delete).
I haven't looked but there maybe tools to help with this type of thing.
Comment #28
kenorb commentedMostly I'm on Windows with TortoiseSVN and Totalcmd. I'm downloading new version, replacing and commiting to repository.
I don't know if there is some workaround to commit and remove non-existing at once.
Workaround is to delete whole folder and commit, and add again new folder and commit again.
You can use Shift-F2 to compare actual directory in totalcmd, what I do every time, but it doesn't compare sub-directories.
I'd like to learn some better practise, but I don't see here any better practise to use.
Comment #30
sun.core commented