appirio-tech / tc-site

topcoder member-facing site
3 stars 19 forks source link

fix issue 932 #458

Closed lijulat closed 7 years ago

lijulat commented 7 years ago

fix issue #932

birdofpreyru commented 7 years ago

@lijulat I've tested my local deploy with you change, and don't see any difference between previous behaviour and what I see now. Do you? Am I doing anything wrong?

lijulat commented 7 years ago

@birdofpreyru . I had trouble running the app locally. The code fix was based on my code analysis.

I am running on windows 10 machine . But my vagrant vm always gives me Authentication failure issue. Any idea?

I would very much like to continue working on this but If you think it will hamper the delivery time, then you may re assign this to some one else.

birdofpreyru commented 7 years ago

@lijulat Yeap, please keep on working on this.

For you problem:

  1. Open Vagrantfile in the code from tc1-mf-vagrant repo, un-comment the config.ssh.password = "vagrant" string. Also make sure that localTCSite = ... variable points to the valid folder with the tc-site code on you host machine.

  2. When you run first, it should complain that you are missing wp-config.php file. You should create it. You put in there the username root, the empty password, and the database wp, it should work then.

Don't hesitate to ask if you have other problems with the local deployment. I've done it work on my machine, but I might forget about some steps.

lijulat commented 7 years ago

@birdofpreyru Thanks for your help. the vagrant is asking me for login details. Do you know what login should be given?

birdofpreyru commented 7 years ago

@lijulat Do you mean, when you do $ vagrant ssh? It should be the same ssh password you state in Vagrant file, which is vagrant if you have not changed it.

lijulat commented 7 years ago

@birdofpreyru thanks. Yes had to un comment the password line. Now the vm is running and I ran the grunt dev task. its running the watch task, But when i navigate to the http://local.topcoder.com/ I get a no input file specified error. Any pointers?

birdofpreyru commented 7 years ago

@lijulat Have you pointed localTCSite variable in the Vagrantfile to the tc-site directory on your host machine? Have you configured the routing on the host machine so that local.topcoder.com points to the IP address of the Vagrant virtual machine?

In principle at this point, if everything is configured right, local.topcoder.com should either show you the website, either complain that there is no wp-config.php file.

lijulat commented 7 years ago

@birdofpreyru

  1. Yes

  2. Yes

  3. Where should i create the wp-config.php ? Do you have sample file

birdofpreyru commented 7 years ago

@lijulat

In my case, it asked itself, when I browsed to local.topcoder.com. That file is a part of the WordPress engine, which is used in part of TC website, and WordPress comes with the tool which creates that file automatically.

Sure, you also can create it manually: in /wp folder you have wp-config-sample.php so, copy, rename, correct it. But, if your local deployment does not ask for it automatically, I would say you should re-check everything else. Probably, it is something Windows-specific, which I am not aware of.

lijulat commented 7 years ago

@birdofpreyru Got it to work . thanks for your help :).

But the site looks different from the live site. capture

Any idea?

birdofpreyru commented 7 years ago

@lijulat This is fine. The production version of TC site uses the endpoints from topcoder-app for some parts (dashboard, profile, some others), and it uses tc-site for some other parts (challenge listing, some other sections). Because of this, there are actually two copies of the top menu, one in each of the repos. So, back to the issue, the menu version and related code from topcoder-app do work fine, the version of the menu from tc-site, which you see on challenge listing page, encounters some error, which breaks the menu, and that's why you don't see user sub-menu there. So, you goal is to find out, what is going on there, and to fix it.

birdofpreyru commented 7 years ago

@lijulat Also, be aware, that there are probably two versions of the top menu in the tc-repo itself. The one from /src is visible in the challenges listing pages, but there is another one somewhere in /wp, which is shown at the pages served by the WordPress. So, be sure to check all of them :)

lijulat commented 7 years ago

@birdofpreyru I actually can see the user menu. capture2 Not sure if am missing something.

birdofpreyru commented 7 years ago

@lijulat Sorry, I didn't look to the screenshots careful enough. What you see, is not quite what you are supposed to see on the challenge listing page http://local.topcoder.com/challenges/develop/active/?pageIndex=1

That page, and the top menu, should look exactly the same, as they look at the www.topcoder.com Try to re-run grunt dev from inside the vagrant VM.

birdofpreyru commented 7 years ago

@lijulat Actually, when I was deploying the local version of this code, the first time I had the same issue, it was serving some old styled pages for the challenge listing, but then, after some manipulations, it started to work right.

lijulat commented 7 years ago

@birdofpreyru I am using the dev branch of the tc-site. Hope thats the right one?

birdofpreyru commented 7 years ago

@lijulat Yes, that's right. So, just rebuild/refresh it, probably it is some caching issue.

Yeah, also, while trying to make it run properly, I have added to my wp-config.php these lines:

define('WP_SITEURL','http://local.topcoder-dev.com');
define('WP_HOME','http://local.topcoder-dev.com');

I'm not sure, whether these have any influence, but you also may try, just in case.

birdofpreyru commented 7 years ago

@lijulat Also, probably, cleaning the cache of you browser might be helpful. I've just encounter a situation, when what I was seeing visiting local.topcoder.com was different from what I had in tc-site, and resetting the cache helped.

lijulat commented 7 years ago

@birdofpreyru Thank you for being patient. I managed to get it running after clearing the cache and restarting my laptop. I have now fixed this.

The PR has been updated . Please check.