Hi folks, I'm new to Drupal and am trying to import a 200+ page site, and I've run into 1 or 2 problems. First of all, htmltidy cannot be installed on my server. However the pages do import. The problems I'm facing are as follows:
Overwrite doesn't overwrite but merges which turned out to be a problem for junk code of my first attempt. Not really your problem.
But I have found that many pages imported with the Site name as the page title. So I have many many pages that are incoherent until they are edited.
Also, no matter what I do, I can't get the pages that are not primary links to show as sub pages of their parents. Something about the hierarchy seems to be broken. If there is an easy fix or instruction, I'd appreciate it.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | samplestructure.png | 27.75 KB | jefferis |
Comments
Comment #1
dman commentedThis weeks -dev had a small issue that may have been 'hiding' your sub-items. What does the menu mangment tree look like?
Regarding the overwrite/merge issue. Hm.
Yeah, the first time through, the menu is built. This creates menu items with the available title.
Second time through - over-write, any existing menu item is left alone (changing menu item ids on the fly makes everything fall apart).
... so yeah, you'd still get the old titles.
Sounds like it may be an OK idea to always update that title for later runs...
Comment #2
jefferis commentedI could see in the menu tree a hierarchical structure. Because I had extra layout in the original upload, I decided to delete all the files from the Import and start over. However that action produced MASSIVE database errors, and I had to reinstall Drupal from scratch. So, is the current dev ready with a fix, or should I wait till?
Comment #3
dman commentedDeleting *files* caused an error? hm.
Comment #4
jefferis commentedYes, I selected all files in content, and deleted. About 9 pages worth. It started spewing an message about database error or corruption.
Comment #5
jefferis commentedLet me know please, when the next version is released. I'm not going to try the import till there's a fix for the submenu thing.
Comment #6
dman commentedI'm using dev daily on a huge site right now - doing CVS checkouts and checkins every few days. I've not seen the database corruption you mention, so without an error message, I can't begin to guess what your exact issue is.
Comment #7
jefferis commentedI am not using the current dev, but the last stable release. Here is the error when I delete files:
user warning: Something is seriously wrong, database may be out of sync. I found a reference to '202' when looking up existing aliases, but that is not loaded as a valid node. We'll proceed by making a new node, cannot merge with the allegedly pre-existing one. in /home/../public_html/sites/all/modules/import_html_process.inc on line 1300.
user warning: Something is seriously wrong, database may be out of sync. I found a reference to '279' when looking up existing aliases, but that is not loaded as a valid node. We'll proceed by making a new node, cannot merge with the allegedly pre-existing one. in /home/../public_html/sites/all/modules/import_html_process.inc on line 1300.
Comment #8
jefferis commentedNEVERMIND. Newbie mistake. I had to create add the primary links to a menu block in a custom site. The menu wasn't available in the default layout.
Okay I switched to the latest dev release and things seemed to go better. However, I still can't get submenus to show. I have a picture of the sample hierarchy. Not sure what to do about the lack of drop down menu functions.
They do appear expanded if I activate primary links in a sidebar, but they are not active with the main menu in the header of the default layout.
Comment #9
dman commentedSo from the snapshot and your description "They do appear expanded if I activate primary links in a sidebar"
... the pages are imported and are in the right place in the menu tree and are not hidden.
And you are left with a theming question? Primary links normally just show the top slice - no deeper - unless you use alternate rendering.
Comment #10
jefferis commentedJust once question. Some of the directories with html pages did not import for some reason. Is there any problem with uploading just that folder of pages into the original folder and just importing those additional files? I'm using the latest dev and it works well. I'd delete the other files already imported. I just see that some of the deeper files did not list or import.
Comment #11
dman commentedIf I understand the question ...
A huge part of import_html is to support re-importing of slightly wrongly-imported content over top of already imported stuff. You can (should) be able to re-import over top many times without fear of double ups.
I know that it takes a few times to get all the exceptions and tuning right, this process is safe to run again and again until we do.
The one key is the import page URL. Leave that in place and later imports will replace.
Dunno about deleting files, just overwrite them.
Can't say which options you selected in the UI, but if you tick a 'directory' checkbox, that should recursively get anything under it.
Not if you just tick 'documents' as that will import just the documents visible on the tree
Comment #12
jefferis commentedI appreciate the help, really!
I found that quite a few links are broken, with an import that listed either a root or relative link as
./myfolder/mypage.html
when it should have been /myfolder/mypage.html and it would have worked fine. But I'm not sure how drupal stores root vs. relative structure, since this is my first go at it.
I have "Use document path" for items with no title.
I have Try to Relink Files by discarding suffixes unchecked and Trim suffixes checked.
When you say leave the IMPORT URL the same, do yo mean I need to leave the path above the same? Which I would do normally. Or do you mean I need to leave the rest of the index.html files in place to maintain their relative relationship?
BTW, I had checked all folders using the top button and it selected all files...
Comment #13
jefferis commentedError MEssages for the folders that didn't import
lots of these above...^
sample of page failures:
Comment #14
jefferis commentedI cleaned up those pages and converted them to xhtml in Dreamweaver. Is xhtml not recognized? Still got the errors above.
Comment #15
jefferis commentedI thought the problme might have been the unconventional naming of these old legacy pages: 2.1lundsford.htm, e.g.
So I edited page names and links in DW, but they still failed to import... with the same error.
Comment #16
dman commentedThat looks wrong. The 'path to create content under' is just the local path - usually blank for root. Not a full URL. That could be your relinking problems.
This means you should turn on clean_urls.
import_html should probably work without clean_urls, but we normally expect it on.
Your HTML errors ... normally get smoothed out by htmltidy ... but
Hm, a DOCTYPE inside the head. Not seen that before. Neither has the validator, I bet!
The only automated way to fix source content that is that screwy is with a special pre-process script. You have to do that custom, because ... each time some new bad HTML turns up, it is something that we didn't expect.
However, if you successfully fixed the validation problem manually anyway, then it should be XHTML all the way.
File names are not a problem at all - though it was worth considering.
The problem is the DOCTYPE in the content.
The only thing worse than tag-soup invalid HTML is tag-soup invalid HTML containing markers that specifically state that the document is actually valid.
I think you need a search&replace to get rid of all those screwy doctype tags - they are throwing off any chance of validation and XML/XHTML processing
Comment #17
jefferis commentedOkay, still having problems. First of all, I converted all the pages in this folder and their doctype xhtml and they all pass without errors in validation.
Secondly, I don't see any way to change this path under the settings. This is a Fantastico install of Drupal into my main website at the root folder
Finally I don't see the option for clean urls in this dev release. It is a bit different than the stable release in management, but I've checked all the additional settings and don't see a way to modify them.
Still getting errors with a clean import. Note my system has tidy but not HTMLTidy installed. Also other pages like these imported just fine. t:
warning: DOMDocument::loadXML() [domdocument.loadxml]: expected '>' in Entity, line: 1 in /home/jefferis/public_html/sites/all/modules/import_html/coders_php_library/xml-transform.inc on line 117.
user warning: Failed to parse in xml source. [sites/default/files/imported/otheo/Otheo.html] in /home/jefferis/public_html/sites/all/modules/import_html/coders_php_library/xml-transform.inc on line 120.
Importing 'otheo/Otheo.html'
Unable to tidy file - htmltidy was unavailable "$message". Returning the original source.
Had XML trouble with the document 'sites/default/files/imported/otheo/Otheo.html'
Unable to tidy file - htmltidy was unavailable "$message". Returning the original source.
Had XML trouble with the document 'sites/default/files/imported/otheo/Otheo.html'
Import_HTML failed to initialize or parse XMLdoc input
Failed to process any node out of file 'otheo/Otheo.html'
Failed to get any results from the attempted analysis of otheo/Otheo.html. The source file path was probably unavailable, invalid, or incorrect. Or it may have been a directory without an index. May also mean that an internal rule excluded the import.
Comment #18
dman commentedSorry, I was thinking of the internals. The destination path is saved as blank if '/', but is displayed on the screen as the real full URL. My confusion there.
Clean Urls is a Drupal setting, not import_html.
Well, that message would seem to tell you that htmltidy is unavailable.
It is possible to run on pure XHTML input without requiring htmltidy, but it has to be real 100% W3C-validating pure XML for that to work. And not many input sources are that clean.
Normally the settings page would complain if you don't have a working copy of htmltidy available. Hm.
Anyway, you need to turn it on or install it.
Comment #19
jefferis commentedThe host won't allow the html tidy to install on the shared server. They tried to get it to work for me but the path would not be recognized by Import HTML
Comment #20
jefferis commentedOkay, there is no rhyme or reason why some pages are importing and not others. I have taken the ones that were not working and stripped them down to the bare minimums. Made them html 4.1 transitional and/or XHTML 1 transitional, gotten rid of all validation errors, uploaded them to their existing folders and uploaded them to a top level to see if that could make a difference, but they just are not importing at all :
I'm sending the file itself. But it is bare bones.
Comment #21
dman commentedI'd love to agree with you, but the validator doesn't.
... this whole pain (trivial errors) is what tidy is supposed to help you with :-} With that tool, it's all taken care of!
I know there are other alternatives (HTMLawed) but I've never tried them.
It's really a shame that entering /usr/bin/local/tidy in the import_html setup [ admin/build/import_html/setup ] like the admin suggested couldn't just work for you.