question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Home Page shows no Campaigns when there are campaigns seeded

See original GitHub issue

when loading HomeController/Index, the page is displaying with no Campaigns image

looking at the view model before it’s sent back to the view, there are six campaigns that were populated from a query handler: image

so we should be showing these campaigns.

Looking closer at \Home\Index.cshtml it looks like we’re using knockout to populate the list of campaigns. Checking out the errors via Chrome’s debugger, looks like knockout is throwing this error: image

Not being a javascript or a knockout guy, my initial guess is knockout can’t “define” ImageUrl b/c it’s included on each CampaignViewModel coming back in the list of campaigns image

and the ImageUrl used on CampaignSummaryViewModel. image

which are both included on the HomePageViewModel returned to the view.

That, or there is a problem with the version of the knockout library we’re using in conjunction with RTM? (this is also a guess).

A very simple fix for this is to not use knockout. We’re showing a simple table of data here, so MVC is the easiest way to make that happen. After a quick refactor to use MVC/razor view to show the data, the page is working again: image

Should I submit a PR for this by “knocking out” 👊 the knockout code?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
VishalMadhvanicommented, Aug 2, 2016

+1 “to change the case used and follow the new MVC standard.” over reverting to pre rtm Json serialization behavior.

1reaction
danielepocommented, Aug 2, 2016

The problem seams be caused is caused by the fact that, in 1.0.0, MVC uses camel case names by default as announced here:

https://github.com/aspnet/Announcements/issues/194

the easiest change would be to change:

services.AddMvc() to services.AddMvc().AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());

as described by the article. But I think it would be better to change the case used and follow the new MVC standard.

These are all the views that could are probably broken because they serialize objects using the Json Helper:

Areas\Admin\Views\Event\Edit.cshtml Areas\Admin\Views\Site\EditUser.cshtml Areas\Admin\Views\Skill\Edit.cshtml Areas\Admin\Views\Task\Edit.cshtml Views\Campaign\Details.cshtml Views\Campaign\Index.cshtml Views\Campaign\Map.cshtml Views\Event_EventScripts.cshtml Views\Home\Index.cshtml Views\Manage\Index.cshtml Views\Organization\Index.cshtml Views\Organization\Organization.cshtml

I’d love to take care of it

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix Google Ads Display campaign not running or ...
Occasionally, you may find that your Display campaigns are not serving as many impressions as you ... Go to the Campaigns page in...
Read more >
How To Use Seeding Campaigns To Grow Your Sales
One of the best ways to do this is to show your brand's values align with your customers. Start by asking yourself what...
Read more >
15 Reasons Your Google Ads Are Not Showing and Their ...
Campaign is paused; No/low search volume; Not bidding enough; Daily budget exceeded; Ad schedule is too restricted; Post-click page is not relevant ...
Read more >
Regular Campaigns
Unlike auto seeding, which seeds a predetermined number of campaigns at random each week, selective seeding enables you to choose which campaigns to...
Read more >
Google Ads For Restaurants | Low-Cost Tactics To Grow ...
Learn how to use Google Ads for your restaurant. Grow low-cost new customer leads and increase repeat visits. New tactics now make Google ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found