Bug #33135
###value_saveDB### don't works within pdf_generator_2
| Status: | Closed | Start date: | 2012-01-11 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | Reinhard Führicht | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
| Votes: | 0 |
Description
Hello,
in subpart submitted_OK I have placed a marker like this:
<h1>###LLL:offer###: ###value_saveDB|tx_sfoffer_domain_model_offer|type### ###value_saveDB|tx_sfoffer_domain_model_offer|offer###</h1>
On submitted page this marker was replaced correctly with: "Auftrag: WEB 12345"
On the same page I have inserted the link to generate a PDF. This PDF get its data from subpart submitted_OK, too. But in PDF the marker is empty.
For now I helped me with an own marker ###OFFER###, the finnisher for saving data to GP and a TS like this:
dataWrap = Auftrag: {TSFE:fe_user|sesData|saveDB|tx_sfoffer_domain_model_offer|type} {TSFE:fe_user|sesData|saveDB|tx_sfoffer_domain_model_offer|offer}
Stefan
History
Updated by Reinhard Führicht over 1 year ago
Hi Stefan,
the problem is: When you submit a form, the finishers are called, in your case Finisher_DB and then Finisher_SubmittedOK.
Finisher_DB stores some values in the internal GET/POST values ($this->gp). You can access these values later on using ###value_saveDB###.
In the SubmittedOK subpart you can use these markers too. But when pdf_generator2 calls the page again to render it, the form is not submitted, but the values are loaded from the log table. There is no call to Finisher_DB, so there is no ###value_saveDB###.
I think the workaround you suggest is in fact the only suitable way to make this possible.
Updated by Stefan Froemken over 1 year ago
Hello Reinhard,
what do you think about following?
Autogenerating markers like this when Finnisher_StoreGP is called: ###value_ses|saveDB|tx_sfoffer_domain_model_offer|type###?
Stefan
Updated by Reinhard Führicht over 1 year ago
Hi Stefan,
Storing the data in the session and auto generating those markers isn't gonna cover all cases, I guess.
If you send the link to the PDF via email and another user opens the link, there is no session, so the values won't be available. Right?
I thought a bit more about the problem.
Here is a summary:
- The form is submitted without errors and it is the last step.
- The saveInterceptors are called
- The loggers are called. Logger_DB puts the form data into the log table
- The finishers are called. Finisher_DB stores values in the DB and stores the data in $this->gp['saveDB']. So the values are available in value-markers in SubmittedOK.
When the PDF is generated:
- The controller loads the data from the log table
- The Finisher_SubmittedOK is called and shows the view again. Problem: The saveDB values are not available.
Solution:
Use Finisher_DB as a saveInterceptor. This way it is called BEFORE the logger and the saveDB values are stored in the log table.
It might seems strange to configure Finisher_DB as a saveInterceptor, but the interface of the classes is the same, so it is possible.
Wouldn't that be a nice solution?
Updated by Reinhard Führicht over 1 year ago
- Status changed from New to Needs Feedback
- Assignee set to Reinhard Führicht
Updated by Reinhard Führicht 11 months ago
- Status changed from Needs Feedback to Closed