Issue whilst upgrading to 4 #52

Closed
Sidesnack opened this Issue Oct 5, 2012 · 71 comments

7 participants

@Sidesnack

Hey,

Just tried to upgrade to Webcomic 4 and I got this nice error:

Fatal error: Call to undefined function first_webcomic_link() in /home/sidesn5/public_html/wp-content/themes/inkblot/webcomic.php on line 5

I have put a {display: none} for the 'first webcomic link', maybe that has caused the issue?

@mgsisk
Owner

Nope; your CSS definitely isn't the culprit. I'm not entirely sure why first_webcomic_link() is supposedly undefined there, but Inkblot 3 isn't compatible with Webcomic 4. There's a brand new version of Inkblot available right here on GitHub (and soon the WordPress.org Themes Directory, hopefully) that is, though.

@mgsisk mgsisk was assigned Oct 5, 2012
@Sidesnack

Ah my bad then, blind upgrade, too excited.

I remember the previous version having a child theme ready to be copied in the Inkblot-theme.

What is the best way to go about creating a child-theme?

@mgsisk
Owner

As the WordPress Codex explains, the only thing required by a child theme is a style.css file that references the original theme. For Inkblot, you would really just need to create a new directory in /wp-content/themes (named whatever you want; inkblot-child is probably good) and then create a style.css file inside of that with the following information:

/*
Theme Name: Inkblot Child
Description: Child theme for Inkblot
Author: YOUR NAME HERE
Template: inkblot
*/

/** Theme styles go here.
 * 
 * If you want to work off of Inkblot's default stylesheet you can add @import url( ../inkblot/style.css );
 */

From there you can copy whatever Inkblot template files you want to customize into the Inkblot Child themes directory and customize them from there. Note that Template: has to be the name of the parent themes directory; I know when you download things from GitHub it tends to add a bit of extra… stuff at the end, so you'll want to make sure you have the directory name correct.

@Sidesnack

Thanks. I know most of this information is in your Wiki, but when you are kind of panicking, you resort to the 'short cut' for your answers.

But now, I kind of have an issue I could not find an answer for in the Wiki; Webcomic isn't showing up in the dashboard. Not in the settings, no where.

I have no indication that the installation has failed though. What did I do wrong?

@Kikirini

I am having this same problem, I have a custom CSS and I haven't messed with the first webcomic link. I'm really not sure what to do, but I'll have a look at the files and see if I can't find anything obviously wrong, but some suggestions would be amazing.

@mgsisk
Owner

@Kikirini As mentioned, you might need to download the latest version of Inkblot. I'm not entirely sure why first_webcomic_link() would be undefined unless Webcomic weren't actually running… are you and @Sidesnack absolutely sure Webcomic is installed and activated?

@Sidesnack No problem; major Webcomic upgrades tend to be problematic. There should be an entry for each of your collections in the Administrative sidebar, as well as a Webcomic Transcripts entry (also in the sidebar), and a Settings > Webcomic page. The general Webcomic sidebar section no longer exists.

@Kikirini

I have downloaded the new inkblot and installed it, the site is no longer broken if I have it set to the inkblot theme but it doesn't show any of my comics.
I thought I would try the "upgrade to webcomic 4" button, but when I hit it I get the error: "Fatal error: Cannot use string offset as an array in /home/kurosh6/public_html/wp-content/plugins/webcomic/-/php/legacy.php on line 870"

And yes, I have made sure that Webcomic is installed AND active.

@Sidesnack

Well, that was weird.

Wordpress told me that Webcomic was installed correctly and activated. Just when I was going to write about my ignorance I decided to deactivate and activate the plugin again, just to be sure.

And then they all popped up.

Seems like that's fixed. Thanks.

I'm going to take my time reading trough the Wiki now.

@Kikirini

I tried deactivating and activating here, as well, but no luck. :(

@mgsisk
Owner

Apologies for the trouble Kikirini. Several others have reported a similar issue, and I haven't been able to figure out what's causing it just yet. If you can, I'd try using the Not Interested button on the Upgrade Webcomic page to uninstall Webcomic 4 and reinstall Webcomic 3 (you can get all previous versions of Webcomic from here or here).

@Kikirini

Phew, everything's working again. Sorry to bug you so much. I really can't wait to see how Webcomic 4 works, once this issue is ironed out. I bet it has lots of cool features :D

@mgsisk
Owner

@Kikirini Glad to hear! Apologies again; hopefully I can get this figured out quickly.

@Sidesnack Any feedback on the wiki is appreciated! I've tried to cover everything as clearly as possible, but there are probably still gaps or confusing bits.

@Seel

I'm also getting "Fatal error: Cannot use string offset as an array in /homepages/9/d373418675/htdocs/wc4/wp-content/plugins/webcomic/-/php/legacy.php on line 870" when trying to import the old stuff.

@mgsisk
Owner

Apologies for the trouble Seel. Until I can figure out what's causing this, downgrading as described above (click Not Interested, reinstall Webcomic 3) is probably your best bet.

@Sidesnack

Bumped into something again, can't figure it out after quite some tries.

I created the Child theme just like you described, but Wordpress keeps telling me this:

Inkblot Child The parent theme is missing. Please install the "Inkblot" parent theme.

I got the theme installed correctly. Before this error it told me that the child theme was missing a template. So I added 'Template: Inkblot' in the head section to try and fix it, but guess it doesn't recognise it.

What should I do?

@mgsisk
Owner

It might just be a capitalization issue. Template: must be the exact name of the directory for the theme you're referencing. So if Inkblot lives in /wp-content/themes/inkblot, you should have Template: inkblot in the style.css file (with a lowercase i).

@Sidesnack

O never mind. After another quick analysis I figured that letter casing may have caused it.

And it did.

Thanks.

(Haha, great timing. Yes, that was it. )

@Sidesnack

Sorry to bother you again, but I'm trying to adjust the color of the webcomic nav and footer since yesterday, but I can't seem to address the right location. Firebug tells me that the #333 color comes from this location:

http://sidesnack.com/?inkblot_custom_styles=1&ver=3.4.2

I had no luck working the #footer or .post-webcomic nav, to overrule it.

Where is that rule coming from? Is that a function?

@Seel

Anything we could do to help you figure this out?

@Sidesnack

I don't know where to begin...?

I know I probably need to get used to the new Inkblot, but my first feel is that it isn't as clearly structured as the previous one.

@Sidesnack

Oh looks like I'm sounding like a negative nancy here.

Want to give you props on the new structure of Webcomic Mike, think it will be easier for new users to pick it up. It's more consistent with the logic of Wordpress. Well done!

@mgsisk
Owner

@Seel Not that I'm aware of at the moment, but thank you. I've taken site exports from a couple of others that have reported the issue to test with… I just need a moment to test now. XD

@Sidesnack Thanks Sidesnack. The ?inkblot_custom_styles stylesheet is a dynamically generated stylesheet based on your theme customizations using the WordPress Theme Customizer (the Appearance > Customize administrative page). You can customize quite a lot through the customizer, including the color of the site navigation and footer (the site trim color in the customizer affects these locations).

Because of how the styles work the dynamic theme customizer stylesheet is loaded after the normal theme stylesheet (your child themes stylesheet, in this case), overriding those styles for the areas the customizer affects to ensure that changes in the customizer take precedence. Because of this the easiest way to change things like this would be to use the customizer.

If you'd rather not use the customizer, however, the next easiest method would probably be to embed styles directly in the theme <head> in the header.php file for those handful of areas the customizer stylesheet overrides your own styles.

@corny63

So I tried to do what you said earlier, which was to uninstall Webcomic 4 and reinstall an earlier version from the links you provided. Problem is, now it's telling me I don't have a collection set as default, and won't let me upload or change anything until I do so. When I set a collection to the default, it'll say 'xxx set to default' but will still tell me I don't have one as if no change actually occurred. What's happening?

@Sidesnack

Ah I see. This probably also means that adjustments like having a 'hover' image in the navigation menu must be put in the header.php also?

On the one hand 'simple' things are made a little bit harder, but I guess the threshold has been lowered for newbies.

I'll give it a try tommorow.

Thanks!

@Seel

You could just add !important to your modifications that should override the customization style.

@Megami-Studios

Okay, I just tried to upgrade and got this response: Fatal error: Cannot use string offset as an array in /home/megami_studios/claudeandmonet.com/wp-content/plugins/webcomic/-/php/legacy.php on line 870

Used the newest version of inkblot and deactivated and reactivated the plugin.

UPDATE: uninstalled v4 and went back to v3; all is back to normal.

UPDATE 2: Now I'm having the same problems as corny above with the added bonus that it's not showing newly posted pages.

@Kikirini

Has there been any luck with this issue? :)

@mgsisk
Owner

As far as a solution: no, unfortunately. D= This thread at the forums might provide some help for people trying to downgrade back to Webcomic 3, however.

@Kikirini

Baw, well I luckily downgraded without much trouble. Still can't wait to try out Webcomic 4. Let us know if there's anything we can do to help. D:

@Kikirini

So, Webcomic 3 doesn't work with the new Wordpress, and I still can't upgrade to Webcomic 4... any suggestions on how to manually upgrade? I'm scared of losing all my readers' comments and such if I try it on my own...

@mgsisk
Owner

Just curious, but what doesn't work? I've tested it myself and Webcomic 3 seems to work perfectly fine except for one minor issue that was reported and fixed last week: https://groups.google.com/forum/m/#!topic/webcomicnu/Xko2CBx1VPA

@Kikirini

Ah! That was my issue! :D You made an update for it? Thanks so much!

@mgsisk
Owner

No problem! It's the least I could do since the Webcomic 4 upgrade continues to be broken ^_^; (though truly, I'd have fixed it anyway).

@mgsisk
Owner

The 4.0.3 update includes a couple of fixes that I'm hoping will address the upgrade-related issues several people have reported. If anyone is still willing please do try it out (after backing everything up, of course).

@Kikirini

No luck. "Fatal error: Cannot use string offset as an array public_html/wp-content/plugins/webcomic/-/php/legacy.php on line 870" :(

@Seel

Still getting the same error on my test WP installation
"Fatal error: Cannot use string offset as an array in /homepages/9/d373418675/htdocs/wc4/wp-content/plugins/webcomic/-/php/legacy.php on line 870"

@nbumpercar
@mgsisk
Owner

Could one of you modify line 870 /webcomic/-/php/legacy.php to look like this:

print_r( $legacy_config ); die;

And share the output here? Thanks!

@Kikirini

I'm willing to try it out, but I keep trying to find that folder on my site with no luck, even if I copy-paste the url into my ftp browser. Where should I be looking for it? (Yeah, I know, I'm a bit of a moron.)

@mgsisk
Owner

Sorry, the full URL would be /wp-content/plugins/webcomic/-/php/legacy.php (wp-content should be inside whatever folder your WordPress has been installed to).

@Seel

You mean just replace it and then try upgrade again? Because it's not printing anything really.

Or actually modify this line of code in some way
$image_id = empty( $legacy_config[ 'term_meta' ][ 'collection' ][ $v->term_id ][ 'files' ][ 'full' ][ 0 ] ) ? 0 : self::update_media_library( dirname( $upload_dir[ 'basedir' ] ) . "/webcomic/{$v->slug}/" . $legacy_config[ 'term_meta' ][ 'collection' ][ $v->term_id ][ 'files' ][ 'full' ][ 0 ], $collection_id );

@mgsisk
Owner

Nope, you had it right the first time: just replace that whole line. You're not getting any output at all when you do that?

@Seel

Nothing at all.

@mgsisk
Owner

Thank you. I've just pushed an updated to GitHub that may help. Please give it a try (make sure to get Webcomic 3 back to a semi-functional state first and, of course, backup everything prior to attempting).

What's Changed

I thought it might be helpful to mention what's actually changed. The first update (which obviously didn't work) changed how the upgrade function fires. Previously it actually wouldn't fire at all if you updated Webcomic using WordPress' auto-update feature. Technically, it only fired when you activated the plugin, which only happens if you happen to click Activate on the Plugins page; most upgrade methods didn't actually trigger the upgrade. This would obviously cause a lot of problems, and should've been addressed in the previous update.

The update I just pushed addresses a more serious issue related to the upgrade: due to blind ignorance on my part, the Webcomic 3 configuration (which Webcomic is supposed to store both to use during the upgrade and to restore if you decide not to upgrade) wasn't actually getting saved. Kind of a big deal, and I'm very sorry for taking so long to catch that (it also explains why users upgrading from older versions have been mostly unaffected by this issue).

With those two rather-significant issues addressed I'm hoping we can at least get passed the string-offset error (at this point I won't be at all surprised if it continues to fail, though). Thank you all for continuing to help with this. You'll all get a special thanks in the read me if this is ever resolved. XD

@mgsisk
Owner

I should mention: the version of Webcomic here on GitHub requires WordPress 3.5.

@Seel

Well I'll be damned, It worked!

@mgsisk
Owner

No other issues or errors you're noticing? I'm probably going to push this out tonight so Webcomic will stop breaking everyone's sites if it looks like things are actually working now.

@Seel

Still testing, I'll let you know in a bit.

@mgsisk
Owner

Thanks! I really appreciate you (and everyone else) helping to resolve this.

@Kikirini

Where can I download the new update here?

@Seel

Okay so, here is the current page with Webcomic 3: http://ahs-comic.com/

I copied it for testing purposes and set it up with glorious Webcomic 4 here: http://ahscomic.com/

No huge differences on the front-end, I already updated the theme to the new inkblot back then, there's still a few things I got to work out but mostly it works fine.

I got a few issues though, most are probably not updgrade related but I'll list em just to be sure:

  • I had the wrong thumbnail settings when upgrading, so WP cut all thumbnails into squares which I didn't want, Is there an easy way to regenerate all thumbnails? Also, I only really want small thumbnails for webcomics, medium and large are just wasting space for me, any way to disable those?

  • Also, there seems to be two small thumbnails for each image, "thumbnail" and "post-thumbnail" which are almost exactly the same size, I'm guessing "post-thumbnail" is some sort of default since I can't get rid of it.

  • I had some issues with "Blog pages show at most X pages" before, like the archive only showing 3 posts if I set it to 3, seems that was fixed, but if you click on a character archive it only shows X number of posts. I'd personally like that to be unlimited, since I'm just using text-links for them, see: http://ahscomic.com/character/mina/

  • Paged blogs always seem to leave out the topmost post except on the homepage, I set my blog to display 3 posts at once, this works on the homepage, but doesn't work on other pages, see: http://ahscomic.com/page/2/ It's only showing 2 posts on these pages and you can't see the omitted posts at all.

I should mention that I had trouble downgrading to Webcomic 3 as well, I decided to just delete everything since that was just a test installation I set up when Webcomic 4 was released, because I figured I might mess something up, like I did when upgrading from Webcomic 2 to 3.

@mgsisk
Owner

Awesome, thank you Seel! This is extremely helpful.

Bulk Thumbnail Regeneration

There is no way to do this, unfortunately. D= Adding a bulk regenerate option was on my list of todo's even before Webcomic 4 was released, and it remains there due to an ongoing issue with WordPress. With the recent Media overhaul I'd hope this is going to become more of a priority for them, but I may look into a custom solution otherwise. In the meantime, this is definitely something that warrants mention in the Beginner's Guide (and probably on the upgrade page itself).

Alternate Image Sizes

This (and the second half of your first issue) is a byproduct of using WordPress' own media manager, unfortunately. By default WordPress will actually create up to four alternate-sized images: large, medium, thumbnail, and the post-thumbnail that you're seeing. The last one is somewhat poorly named now; it's actually the size that's used for post Featured Images, and is controlled (to my knowledge) exclusively by themes; themes actually have to enable post thumbnail support (which Inkblot does).

I'm not aware of any way to prevent WordPress from generating these alternate-sized images apart from the old stand by of setting their dimensions larger than the images you're uploading (which would now affect all image uploads since Webcomic is tied to the media manager). You might be able to get rid of the post-thumbnail size by removing that particular feature from the theme (in Inkblot, comment out lines 121 and 141 in functions.php).

Archive Paging

This is definitely a theme issue, and it might make sense to add an option for this to Inkblot. In the meantime, though, it's not overly complicated to fix. If you open up Inkblot's /webcomic/archive.php template file, you should see this at the top:

query_posts( array_merge( $wp_query->query_vars, array( 'order' => 'ASC' ) ) );

To show all posts (on all Webcomic-related archive pages, including collection, storyline, and character archives), change it to this:

query_posts( array_merge( $wp_query->query_vars, array( 'order' => 'ASC', 'posts_per_page' => -1 ) ) );

To show all posts on specific archives (like only character archives, for example) you can do something like:

if ( is_webcomic_character() ) {
    query_posts( array_merge( $wp_query->query_vars, array( 'order' => 'ASC', 'posts_per_page' => -1 ) ) );
} else {
    query_posts( array_merge( $wp_query->query_vars, array( 'order' => 'ASC' ) ) );
}

Incorrectly Paged Posts

This one also sounds like a theme issue, but I can't seem to duplicate it. =/ Things are working as expected on my dev box with a clean install of Webcomic 4 and Inkblot 4; could you send me your theme to look over?

Thanks again! I'm glad this may finally be resolved. XD

@Kikirini

So glad it's fixed! But seriously, where do I download it xD I want to test it and see if it works here. :D

@mgsisk
Owner

Sorry Kikirini. XD First: if you didn't manage it yet, try just saving your Webcomic settings. This should rebuild the Webcomic 3 settings array and allow you to actually set a default collection.

You can download Webcomic 4.0.4 from right here on GitHub: just click on the Code tab at the top, and then look just under that navbar for a ZIP link with a little cloud icon next to it. Clicking that will download the most up-to-date version of Webcomic.

@Kikirini

Haha, okay. Crossing my fingers and hoping it works here, too. :D

@mgsisk
Owner

Let me know how it goes! I'm fairly confident in the upgrade process now that it's actually running (and not just throwing away your Webcomic 3 settings), but if there are any more issues I'd like to get rid of them.

@Kikirini

Ahhh! Mine did not work. I'm getting a never ending cycle of these errors:

Warning: Division by zero in /home/kurosh6/public_html/wp-content/plugins/webcomic/-/php/legacy.php on line 1067

Warning: Division by zero in /home/kurosh6/public_html/wp-content/plugins/webcomic/-/php/legacy.php on line 1068

Warning: Division by zero in /home/kurosh6/public_html/wp-content/plugins/webcomic/-/php/legacy.php on line 1069

@mgsisk
Owner

Actually, it may still work if you just let it go. You definitely shouldn't be getting those, however; I'll work on it now.

@Seel

Oh no!
Now I'm getting all self-conscious about my bad html/css etc. !
Also, I didn't go with the inkblot-child theme because I couldn't get it to work at the time, so I modified Inkblot directly and decided to keep up with the updates by copy-pasting all the commit changes into my hacked theme. It could be where something went wrong.

Anyway, I'm sending you my crappy theme, I'll try fixing the rest tomorrow.
Thanks for the help!

@mgsisk
Owner

The latest commit should prevent those division by zero errors.

@Kikirini

Yeah, some of my pages did get imported despite the errors, so I'm definitely happy that something happened.
Though not all my pages went through, is there an option to try to import the rest?
Or do I just try to upgrade again?

@mgsisk
Owner

There isn't at the moment… you'd probably have to reinstall Webcomic 3 and try the upgrade again. _; Is there anything notable about the posts that didn't get converted?

@Kikirini

I actually noticed that the upgrade tool is still there, so I tried it again. Everything went through this time, and the back end looks beautiful, but the front end is kicking back this error:

Fatal error: Call to undefined function the_webcomic_object() in /home/kurosh6/public_html/wp-content/themes/kuroshouri/webcomic.php on line 6

I'm gonna throw on the update you just made, in the meantime. But right now, BOOYA, it's nice to have finally upgraded! xD

@mgsisk
Owner

Aaah, ok. It's possible the upgrade was taking too long. What's supposed to happen (and what may have happened without all those warnings showing up) is that, if it's taking too long–which may happen with larger Webcomic sites–the upgrade will actually stop itself and warn you that it's paused to prevent a server timeout. There's a bit of javascript that kicks it back into gear after a few seconds (ten, I think), but in the event that it doesn't automatically restart there's also a button you can click to continue the upgrade.

What theme are you using? The the_webcomic_object template tag no longer exists in Webcomic 4; it's just the_webcomic now. You may need to grab the new Inkblot or Archimedes.

@Kikirini

That makes sense, my comic has over 900 pages, so it seems likely that it would have stopped.

And ack! I had a custom theme made for the old Webcomic. I guess I'll have to learn some CSS if I want to fix this, then...

@Kikirini

Either way, thanks so much for all the help, and it's super awesome to finally have this working :)

@mgsisk
Owner

You can also try swapping out the template tags; the new ones are fully documented, and many of them are even named the same (they just work slightly differently).

Thank you! I'm really sorry everyone had to suffer their sites blowing up because of two extremely easy to fix oversights on my part, and that it took so long to resolve them. T_T I swear I looked over the function that saves the Webcomic settings a hundred times and never noticed that it actually wasn't saving them for Webcomic 3.

@Kikirini

Thanks, I'll try that out. Does the wiki show what the tags used to be? So I know what to switch out?

@mgsisk
Owner

It does not, unfortunately, but I could probably put something like that together.

@Kikirini

Ah, I'll just see what I can fix until then. Sorry to keep bothering you. ^^;

@mgsisk
Owner

Closing this issue (and others like it). Further upgrade troubles can be reported in new issues.

@mgsisk mgsisk closed this Jan 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment