Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Keep Page URL fragments when tracking Page URLs" not persistent #9896

Closed
AndrewIsh opened this issue Mar 8, 2016 · 10 comments
Closed

"Keep Page URL fragments when tracking Page URLs" not persistent #9896

AndrewIsh opened this issue Mar 8, 2016 · 10 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@AndrewIsh
Copy link

I am having trouble setting the "Keep Page URL fragments when tracking Page URLs" option for a website. The site is tracking fine. The select box for the "Keep Page URL fragments when tracking Page URLs" option has no value selected. When I select "Yes", then click "Save", it appears to save OK. But when I go back to the config menu for that website, the option is once again unselected.

Any ideas anyone?

@sgiehl sgiehl added the Bug For errors / faults / flaws / inconsistencies etc. label Mar 8, 2016
@sgiehl
Copy link
Member

sgiehl commented Mar 8, 2016

The value seems to be saved in the database correctly. But the saved value isn't preselected. Seems to be a bug.

@sgiehl sgiehl added this to the 2.16.1 milestone Mar 8, 2016
@tsteur
Copy link
Member

tsteur commented Mar 15, 2016

I tried to reproduce but couldn't. Maybe I don't understand this part correctly:

But when I go back to the config menu for that website, the option is once again unselected.

Whatever value I select and save for a website, when I open the website again, it's always correctly preselected. Tested with latest Chrome and latest Piwik 2.16

@sgiehl
Copy link
Member

sgiehl commented Mar 16, 2016

I'm able to reproduce that on my local instance. When editing any website most of the select values are not correctly preselected. Only selection of currency and time zone is correct.

Chrome dev tools are showing this generated html for the fragment selection:

<select ng-options="key as value for (key, value) in keepURLFragmentsOptions" ng-model="site.keep_url_fragment" class="ng-pristine ng-valid">
  <option value="?" selected="selected" label=""></option>
  <option value="0" label="No (Default)">No (Default)</option>
  <option value="1" label="Yes">Yes</option>
  <option value="2" label="No">No</option>
</select>

@tsteur
Copy link
Member

tsteur commented Mar 17, 2016

Which browser are you using? I can prepare a patch to see if it changes something... maybe you can test it afterwards. I'll comment in a bit

@tsteur
Copy link
Member

tsteur commented Mar 17, 2016

Can you try the following change?

I couldn't test it since I'm on a branch and cannot switch easily but it should work:

master...9896

@sgiehl
Copy link
Member

sgiehl commented Mar 17, 2016

latest Chrome on Windows 7 but doesn't work on Firefox, aswell.
Tried your proposed change, but it didn't help

@sgiehl
Copy link
Member

sgiehl commented Mar 21, 2016

@tsteur I've adjusted the branch a bit. Using integers as keys solves the problem for me. Would you check if it still works and merge it to master if so.

@tsteur
Copy link
Member

tsteur commented Mar 28, 2016

I think that would break it on other systems. It seems to depend whether you get from database or rather from API an integer or a string. In my case I'm getting "ecommerce":"0". We'd basically have to convert all ng-models to integer or to string and also use the same for options. I might be able to work on this later.

@tsteur
Copy link
Member

tsteur commented Mar 28, 2016

@sgiehl I pushed 95e23b7 and now it should always work as it will always use integers. Before you pull you can likely try to create a new site and see it wouldn't pre-select anything because it expected strings. Now it should always work with integers and work in all cases.

@tsteur tsteur self-assigned this Mar 29, 2016
@mattab
Copy link
Member

mattab commented Mar 29, 2016

FYI, AFAIK it's possible this inconsistency (int VS string) comes from the MySQL adapter used (PDO vs Mysqli).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

4 participants