Closed (fixed)
Project:
Facebook-style Statuses (Microblog)
Version:
6.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Aug 2011 at 17:31 UTC
Updated:
9 Sep 2011 at 21:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
icecreamyou commentedAwesome! I'm glad you're interested in contributing back.
Basically there are two ways to approach upgrading the code.
I haven't tested the upgrade yet, but in terms of what I know for sure is currently not working -- Views integration, AJAX submitting, and all submodules are the big things. The AJAX stuff is very complicated because FBSS 6.x overrides some of Drupal core's AJAX handling and I haven't looked at how that translates to D7 yet but the AJAX system has changed a lot. If you want an easier target, once you can get the module to install without WSODs, just turn off AJAX submitting in the module's settings and see if you can get Views integration to work. Since Views is really how statuses are displayed it will be pretty hard to find other bugs until we have that. I suspect that Views hasn't changed that much, it's more of a matter of accommodating the new database API in Drupal 7.
It's a big module, so I understand if you feel kind of lost. Please do reach out to me and ask if you have an questions though -- and thank you for contributing!
Comment #2
nikkubhai commentedIs it ok if I ask you further questions in this issue itself ? I hope I won't increase your trouble you instead of helping.
So here is the first problem.
As soon as I enable the main module: Facebook-style Statuses . I get WSOD saying,
" Parse error: parse error in C:\wamp\www\drupal\sites\all\modules\Statuses\facebook_status.module on line 274 "
I found that in the file facebook_status.module , there is a syntax error on every line which has the words: $account->uid
So definitely the expression "$account->uid" needs to be changed. What can be the solution for it or how shall I find the solution?
Thanks
Comment #3
icecreamyou commentedSure.
Usually if I don't see the error immediately the best approach is to figure out what values the relevant variables hold (using your IDE or by printing them to the screen using the
dsm()function if you have Devel installed ordrupal_set_message(var_export($variable, TRUE))if you don't) and then figure out how they got those values by tracing back through the code. If that doesn't reveal anything, break the relevant code down into smaller parts and try each part one by one to see if you can identify the problematic part. Sometimes this means running code outside of the module, e.g. using the "Execute PHP" page provided by the Devel module at/devel/phpto run statements and see if they have errors or return the expected values. Often the problem is with the code immediately before the error that PHP reports -- PHP will throw an error when it encounters something unexpected which usually happens when something in the code just before that is missing some syntax.Comment #4
nikkubhai commentedWith the help from DamienMcKenna , I commited changes to https://github.com/IceCreamYou/Statuses/ and sent you a pull request at Github. Please Check.
The changes are same as mentioned in patch in http://drupal.org/node/671822#comment-4842274
Comment #5
icecreamyou commentedAwesome! Thanks! Merged your pull request.
Comment #6
damienmckennaThe patch I supplied has an extra syntax fix for fbss_comments.module:
Comment #7
nikkubhai commentedThanks Damien. I will send a pull request for this too.
Comment #8
nikkubhai commentedI sent one more pull request.
I have a doubt here. You made a commit " Minor code style fix " to https://github.com/IceCreamYou/Statuses . but , this wasn't committed to my branch. So , how do I keep my branch up to date with yours?Understood it.Comment #9
nikkubhai commentedHi. I am completely stuck at this.
Fatal error: Call to undefined function db_prefix_tables() in C:\wamp\www\drupal\sites\all\modules\Statuses\includes\views\handlers\facebook_status_views_handler_filter_autotype.inc on line 17
I asked for suggestions in irc , and got help from chx. Here is our conversation.
Even the above code didn't work. So, I don't know what to do here. Please resolve it so that I can proceed further.
Comment #10
icecreamyou commentedDoes this commit resolve it for you?
My problem is that Views for D7 isn't documented. The "official" documentation for
$query->add_where()is here, but it's the 6.x-2.x version, and I don't know whether it changed in D7.FBSS provides a bunch of Views handlers and most of them probably need to be changed like this.
Comment #11
nikkubhai commentedThe commit doesn't work. I get this error
'Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'USER \'1\') ))) subquery\' at line 2'
in views_plugin_query_default->execute() (line 1386 of C:\wamp\www\drupal\sites\all\modules\views\plugins\views_plugin_query_default.inc).
So, what should I do now?
Comment #12
nikkubhai commentedI created an issue in views and got help from deriene and it works!!! :D
I have sent a pull request. Please apply only the last (most recent) commit.
Also, now there are no WSOD :D ( I have only fbss and fnss comment enabled)
But, the fbss block shows nothing but just the word "array"
Comment #13
nikkubhai commentedThe attached screenshot. How should I deal with this?
Comment #14
icecreamyou commentedI had to merge by hand because your changes weren't against HEAD, so I made a minor formatting change, but should be fixed now.
Yay! \o/
Rendering the block starts in hook_block_view() which calls theme('facebook_status_form_display'). Apparently that theme call is returning an array, probably because drupal_get_form() returns an array in D7 instead of an HTML string. I think that just wrapping that call in drupal_render() should fix that -- a change I've just committed.
Comment #15
nikkubhai commentedNow I get wsod with this error:
"Fatal error: [] operator not supported for strings in C:\wamp\www\p\includes\form.inc on line 3587 "
This error has also been found in webform module where they fixed it through this patch: http://drupal.org/files/issues/838016.patch
As we can see they have simply replaced
#attributes' => array('class' => '***'),
with
#attributes' => array('class' => array('***'))
Shall I do the same? If yes, which files should I look for?
I also get this warning
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in _form_set_class() (line 3988 of C:\wamp\www\p\includes\form.inc).
Comment #16
icecreamyou commentedCommitted a fix for that. I just ran
grep -rn array.'class' => 'to find places where the class attribute was defined as a string.Comment #17
nikkubhai commentedWow ! I saw the facebook share status block for the first time. :D
Now when I click on share button, I get this error.
" Fatal error: Call to undefined function facebook_status_box_validate() in C:\wamp\www\p\includes\form.inc on line 1409 "
Also I am thinking whether I am really helping? I haven't done anything except pointing out errors. :(
Comment #18
icecreamyou commentedYay! \o/
Clues:
Those clues indicate that the problem is most likely that the status update form validate function isn't loaded at the stage in the submit process that it's needed. In other words, facebook_status.form.inc hasn't been included in the AJAX callback by the time the validate function needs to be run.
You're definitely helping. You've helped prod me into making progress, and you also solved a few issues like the Views thing, saving me from having to go do the research on my own. Additionally if you are learning something from this process it is a good use of my time to help you understand the errors you encounter, because if I can foster a Drupal contributor, chances are you'll contribute back more than I can help you with. :) I hope that my explanations of the errors you've found will help you solve similar errors in the future.
Comment #19
nikkubhai commentedThanks for your reply Ice!
I noticed that you have uploaded 7.x dev version of fbss to d.o. : http://drupal.org/node/1248570
So shall I continue with pull requests on github or create issues in fbss queue here from now on wards?
Also the dev version is not updated with git one's. It gives the same errors which we solved previously.
Comment #20
icecreamyou commentedDevelopment is still happening on github, and you should still submit pull requests there, but I created the dev release so that issues could be opened against it on drupal.org by people who are just testing and aren't able to do any development. I will move the code back to drupal.org soon but for now github is still where development is happening.
Comment #21
icecreamyou commentedNow that the D7 port has its own issue queue, I think this issue can be marked as fixed now. :)