Bug #15286
closedProblem with FORM action. Wrong action url
0%
Description
i'm trying to connect form object with some news element
so url of page with form and news looks like index.php?id=X&tx_ttnews[tt_news]=Y
but action in FORM looks like index.php?id=X.
ok. i can fix it via ts:
form = FORM
form.type=index.php?id=X&tx_ttnews[tt_news]=Y
but if realurl is enabled action url still looks like index.php?id=X&tx_ttnews[tt_news]=Y
(of course, realurl is configured for tt_news)
so i see 2 problems:
1) FORM doesn't include automatically GET params in action url
suggestion: lets add some flags (string or int).
smth like this:
form.includeAction = tt_news[tt_news], photo, ... // include these GETs in action
form.includeAction = 1 // include all GET params in action url
form.excludeAction = ..... ?
2) "type" property doesn't work properly with realurl - there is no
transformation, if "type" is string var
(issue imported from #M2046)
Updated by Dmitry Pikhno almost 19 years ago
Please, take a look at my bug if you have time
Updated by Oliver Klee almost 19 years ago
If the action should point to the current page's URL, it might work to have an empty action attribute (yes, that's allowed in XHTML).
Updated by Dmitry Pikhno almost 19 years ago
i know this Oliver, thnx :)
but i cannot force FORM object to generate empty action.
i'm talking about function FORM in class.tslib_content.php
Do you now some way to make empty action in FORM via ts?
Updated by Oliver Klee almost 19 years ago
After having a closer look at tslib_content::FORM, I haven't found a simple way to have an empty action. :-( Maybe we need to change that function?
Updated by Sebastian Kurfuerst almost 19 years ago
Hi,
it isn't possible to say
form.action =
?
If not, maybe it is possible for you to implement this?
Greets, Sebastian
Updated by Dmitry Pikhno almost 19 years ago
ok. i found solution
Manual(TSref) says that FORM.type is (int) or string var, but it doesn't say that FORM.type also uses stdWrap properties!
so in my case:
voteform.type.typolink.parameter.data = page:uid
voteform.type.typolink.addQueryString = 1
voteform.type.typolink.returnLast =url
but take care, "addQueryString" works only in >3.8.1(http://bugs.typo3.org/view.php?id=1770)
Updated by Dmitry Pikhno almost 19 years ago
upd: as i just noticed my solution works only if realurl is disabled.
otherwise(realurl is ebabled), addQueryString doesn't see query string
it is strange because this is works fine with realurl
voteform.type.typolink.additionalParams=&tx_ttnews[tt_news]={GPvar:tx_ttnews|tt_news}
voteform.type.typolink.additionalParams.insertData=1
seems that realurl affects on $_GET but doesn't affect on $_SERVER[QUERY_STRING]
so i suggest ot use
$addQueryParams = $conf['addQueryString'] ? t3lib_div::implodeArrayForUrl('', t3lib_div::_GET()) : '';
instead
$addQueryParams = $conf['addQueryString'] ? '&'.t3lib_div::getIndpEnv('QUERY_STRING') : '';
Updated by Michael Stucki almost 19 years ago
So what is the problem now? As it seems, addQueryString does not work with RealUrl? If that would work, would it solve your problem?
Updated by Dmitry Pikhno almost 19 years ago
yes. this will solve the problem with realurl
$addQueryParams = $conf['addQueryString'] ? t3lib_div::implodeArrayForUrl('', t3lib_div::_GET()) : '';
otherwise addQueryString works only with disabled realurl
Updated by Martin Kutschker almost 19 years ago
I'll fix addQueryString to work with _GET instead of the enviroment varaible QUERY_STRING.
Updated by Martin Kutschker over 18 years ago
In 4.0 you can do this:
voteform.type.typolink.parameter.data = page:uid
voteform.type.typolink.addQueryString = 1
voteform.type.typolink.addQueryString.method = GET
voteform.type.typolink.addQueryString.exclude = cHash,someotherarg
voteform.type.typolink.returnLast =url
So I think we can close this bug.
Updated by Bjrn Kraus over 18 years ago
The target attribute in the form tag says "{$PAGE_TARGET}" ... forgot something here?
Updated by Michael Stucki over 18 years ago
That is caused by bug #15752. Will this solve your problem?
Updated by Martin Kutschker over 18 years ago
Does note #6509 and #6534 help you? IMHO the issues should be solved in the latest CVS version.