typoscript condition GP not done - typo3

I encountered such a problem in the script. I have a condition but it does not work. I do not understand why I tried different meanings but did not help anything. Who can say why?
I used Typo3 6.2
[globalVar = GP:tx_store_storelocatorframe|store != 0]
Also, when the value is displayed in this way, then I get the correct result in the browser.
page.10.wrap.data = GP:tx_store_storelocatorframe|store
The reason may be that the value is of the String type ?

I recommend using the following condition/ operator. If needed, you can add an else branch to check what's going on.
[globalVar = GP:tx_store_storelocatorframe|store > 0]
...
[else]
...
[end]

Related

Problem with wildcard parameter in crystal reports

I´ve created a wildcard in crystal using the like-function:
If {Z_QM_INFOSET_CR_NEU.ZQM_DELIVERY-MATNR} Like {?Parameter field with wildcard} Then True Else False
My entered pattern looks like this (for example): ??S6???-????
What I get back is kinda strange. Crystal is now looking for everything with an "S" in the third place, what comes after that "S" in the parameter field is ignored. So everything looking like ??S????-???? is found.
Is there a way to extend the Like-function (or any other option) to make him look for the exact input of the parameter field?
Thanks in advance!
I can't imagine that ...Then True Else False and... is really intended and think what you need is this:
If {Z_QM_INFOSET_CR_NEU.ZQM_DELIVERY-MATNR} Like {?Artikel mit Wildcard}
and {Z_QM_INFOSET_CR_NEU.ZQM_DELIVERY-BWART} = "601"
and {Z_QM_INFOSET_CR_NEU.ZQM_DELIVERY-WERKS} = "0010"
and {Z_QM_INFOSET_CR_NEU.ZQM_DELIVERY-WADAT_IST} = {?Datum}
and {Z_QM_INFOSET_CR_NEU.ZQM_DELIVERY-VTWEG} = "01" Then
True
Else
False

OctoberCMS scope not applying

So the scenario here is that i'm trying to create a simple scope in OctoberCMS that will allow me to filter a query with the builder plugins list component. In my model I have defined the scope as such:
public function scopeFirst($query)
{
return $query->where('practice_name',1);
}
This should just constraint the query to fetch only the records where that value is 1. The Component is recognizing this scope and allowing me to choose it from the drop-down list, as indicated by my index.htm file:
[builderList]
modelClass = "vetadmin\Practicedetails\Models\Practicedetails"
scope = "scopeFirst"
displayColumn = "id"
noRecordsMessage = "No records found"
detailsPage = "-"
detailsUrlParameter = "id"
pageNumber = "{{ :page }}"
Does anybody have any ideas of what could be causing it to not apply the constraint? Currently -all- the records are being returned. The documentation isn't particularly elaborate on this and just suggests you need to define the scope in your plugins model php file (as I've done)
https://octobercms.com/docs/database/model#query-scopes
is the documentation i'm referring to.
Thanks.
Hmm this is little confusing for the larval eloquent model
I have tested your code and scope
Then I just realised that scopeFirst can be apply on modal like this $modal->first() <= this is issue its reserved method
As per my knowledge first [ref: https://laravel.com/docs/5.7/eloquent] is method to get first record from the collection/models. [ So, your scope is treated like that and ended up doing nothing ! ]
So, just change your scope name like scopeFirstPractice etc.. can solve our issue.
and just normally use
[builderList]
modelClass = "vetadmin\Practicedetails\Models\Practicedetails"
scope = "scopeFirstPractice"
It should definitely work. [ I have tested. ]
if any doubt please comment.

TYPO3 config.linkVars gets cached

I'm just wondering about the behavior of config.linkVars = test(0-100).
My expectation was that all links generated with Typolink will now add the current value of the GET var - lets say &test=66 - to all links of the page. That basically works, but TYPO3 will cache the whole site for all users now even if they have this GET param or not. So every user receive all links containing &test=66 even if they dont have the GET param in their or URL or another value of this GET var.
I though TYPO3 should generate a new cache for each possible value of the config.linkVar?
Tested with and without realUrl and with and without [FE][cHashExcludedParameters] = test in the install tool.
Different cache spaces are by default generated for each typoscript-condition.
As long as you have no specific condition no cache space is generated and all generated content is stored in one space. Independent of individual setting of test with first value of test.
as your range for test is very wide you might need to insert a big block of conditions into your TS
[globalVar GP:test = 1]
[globalVar GP:test = 2]
[globalVar GP:test = 3]
[globalVar GP:test = 4]
[globalVar GP:test = 5]
:
[globalVar GP:test = 99]
[globalVar GP:test = 100]
[global]
If you only need some single values try to define it
config.linkVars = test(0,14-16,38,66,100)
Is there maybe now a less "hackish" solution for this? That workaround only works when the values are known.

Possible to isElementPresent(:id, "id") in watir webdriver

Using Watir Webdriver, I wanted to have a helper that would check for any element with given id. I may not know what type it is ( button or link or text). Can I just do
browser.Element(:id, id).exists
All of the examples i've found on google check against a specific element type, as in
browser.button(:id," ").exits
If there is a way, please share the syntax.
In Watir-Webdriver, I would use something like this:
browser.element(class: 'post-tag').exists?
which would find the watir-webdriver tag on this page and report that it exists. Note that I used the 1.9 syntax instead of the alternative syntaxes of:
browser.element(:class => 'post-tag').exists?
or
browser.element(:class, 'post-tag').exists?
As Dave points out, there is #element method. (You were wrong just in capitalization, it is not #Element.)
Since you are asking about accessing it using id attribute, try this:
browser.element(:id => id)
I've never gotten .exists? to work right on it's own.
What I've had to use in these cases has been to explicitly validate the "exist?"... like:
cf_checbox = #browser.text_field(:id=>'continue-ring', :value=>true).exists?
assert( cf_description == true)
without that explicit assertion, I would always get a "true" even when the value didn't exist.

Else part never getting executed in crystal report formula field

I have a simple formula in crystal syntax which looks something like this :
if isdate(totext({Absence Details.Return to Work Interview Date})) = true
and {Absence Details.Return to Work Interview required} = true then
1
else
0;
This is the actual code of the formula
but the else part is never getting executed, when the condition is not true report just shows blank. I am not sure what I am doing wrong here.
Thanks in Advance.
- Amit
Maybe you have some null value in your fields - in such case crystal just returns null. You then need either "convert null values to default" setting for report or explicit testing against nulls.
Edit: NM, code was posted to the comments. Doesn't look like this is the issue.
My guess, assuming you've debugged correctly is that you've got a semicolon somewhere you shouldn't.
if {something} = x then
do something;
else
do something different;
instead of
if {something} = x then
do something
else
do something different;
This would cause the behaviour, assuming it doesn't choke on the orphaned else clause. But as the comments say, short of posting real code, we can only guess at what's going on. It could be as simple as your evaluation is always true.
Change the 0 to a 7 and see if it actually prints 7. Some report generation tools (and I have little experience with Crystal but quite a bit with others) will leave fields blank if they're zero - this often helps in reading the report by reducing unnecessary clutter.
If the 7's print out, then that's what the problem is, and it's a matter of figuring out how to get Crystal to output an actual 0.
That may be a matter of configuring the output field or even stting it to a textual "0" instead of numeric 0.
Of course, if that doesn't print out 7's, then feel free to let me know.