[MAGNOLIA-800] URL manipulation in javascript does not take into account page level links (#) Created: 30/Mar/06 Updated: 23/Jan/13 Resolved: 04/Jul/07 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | admininterface |
| Affects Version/s: | 2.1.5 |
| Fix Version/s: | 3.0 Final |
| Type: | Bug | Priority: | Minor |
| Reporter: | Tom Jensen | Assignee: | Chris Miner |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 5m | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | 5m | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Date of First Response: |
| Description |
|
This problem effects the following javascript functions: mgnlUpdateCK() in /admindocroot/js/general.js and If a content editor clicks on a link that is within the current page (such as <a href="#bottom">) the url is appended with the #bottom. When clicking on the preview button after that it will not do a new request to the server because the parameters are appended AFTER the #bottom. Need to split off the page level link first. Suggest changing the methods like the following: function mgnlUpdateCK(href) } ------------ function mgnlAddParameter(href,name,value) { tmp=href.split("#"); anchor=(tmp[1]!=null ? "#"+tmp[1] : ""); href=tmp[0]; var delimiter; if (href.indexOf("?")==-1) delimiter="?"; else delimiter="&"; return href+delimiter+name+"="+value + anchor; }------------ function mgnlRemoveParameter(href,name) var tmp=href.split(delimiter+name+"="); return href2; tmp=href.split("?"); var newHref=tmp[0]; for (var i=0;i<paramObj.length;i++) } |
| Comments |
| Comment by Chris Miner [ 03/Jul/07 ] |
|
Committed revision 9902. adding and removing parameters now respects possible anchor portion of href string. |
| Comment by Chris Miner [ 03/Jul/07 ] |
|
change not yet made in the trunk. |
| Comment by Chris Miner [ 04/Jul/07 ] |
|
updated trunk as well. Committed revision 9916. |