How to fix "ErrorException' in blade in laravel-5.3 - laravel-5

purchase
this is my problem to send plan object argument to frontend.subscribe.index
ErrorException in UrlGenerationException.php line 17:
Missing required parameters for [Route: frontend.subscribe.index] [URI: subscribe/{plan_id}]. (View: C:\xampp\htdocs\larafiles\resources\views\frontend\plans\index.blade.php)

You're closing the route function too early. Move the closing bracket to the end:
{{ route('frontend.subscribe.index', [$plan->plan_id]) }}

Related

Cannot pass parameter with near call

I'm testing the Greeting contract in "workshop--exploring-assemblyscript-contracts" and try to pass parameter to saveMyMessage function but always get error. There maybe problem with quotations marks, I tried with " or '` but nothing succeeds. I'm running it on Windows.
This is the suggestion from the code:
near call greeting..testnet saveMyMessage '{"message": "bob? you in there?"}' --account-id .testnet
When I try
near call %ID% saveMyMessage '{"message": "bob? you in there?"}' --account-id %ID%
Or replace " with " or end single quote with ` always get error like this
Unknown argument: bob? you in there?}'
For starters, it appears you have a syntax error with 2 dots instead of 1 here - greeting..testnet
Have you tried seeing what %ID% is?
I would try the following syntax, but make sure when you set your IDenv variable, that it returns the correct value when you run echo $ID
Once you have your env variables set up correctly, try the following:
near call $ID saveMyMessage '{"message": "bob? you in there?"}' --account-id $ID

Getting a WARNING and ERROR: unexpected keyword argument 'queryset'

Unexpected keyword argument 'queryset' in constructor call [E:unexpected-keyword-arg]
Tried using form_kwargs as shown on stack overflow here:
# How to use the new form_kwargs on an inline formset?
if request.method == "POST":
ctx['formset'] = project_comparison_form_set(
data=request.POST, files=request.FILES, queryset=ctx['projects'])
ctx['data1'] = request.POST.copy
if ctx['formset'].is_valid():
instances = ctx['formset'].save(commit=False)
for project in instances:
project.save()
Getting both a warning and error message in pylint Unexpected keyword argument 'queryset' in constructor call [E:unexpected-keyword-arg]
You don't show where project_comparison_form_set is defined, but i assume that it is a modelformset_factory.
Here, you do not have the queryset argument. If you do want to pass a queryset, you can pass it to the formset and the formset than to the modelformset_factory.
Check the documentation https://docs.djangoproject.com/en/4.1/topics/forms/modelforms/#changing-the-queryset.

Container::getAlias($abstract) throws ErrorException: Illegal offset type in isset or empty when $abstract there is not in $this->aliases[]

Laravel Version: 5.6.16
PHP Version: 7.2.3
Database Driver & Version: N/A
Description:
laravel\framework\src\Illuminate\Container\Container.php public function getAlias($abstract)
throws ErrorException: Illegal offset type in isset or empty
when $abstract there is not in $this->aliases[]
$this->aliases[$abstract] is null and !isset($this->aliases[$abstract]) throws ErrorException: Illegal offset type in isset or empty
$abstract value is Modules\Administration\Tests\Commands\StubJsonCommandHandler
Steps To Reproduce:
Run AdministrationControllerTest (https://github.com/proyectotau/TAU/ clone laraveldusk branch [4ef9b0e124657abed7afde0969f332bf7be95a8b])
Is it a bug or I have any mistake? Thanks in advance!
When binding an instance to the container, please make sure you are using:
app()->instance('dependency', $instantiation);
not,
app()->bind('dependency', $instantiation); // DON'T bind an instance
Attempting to bind an instance will result an error, as the container tries to index possible aliases using a concrete object as opposed to a type.
Workaround
Change in getAlias() function
! isset($this->aliases[$abstract])
for
! isset($this->aliases[(string)$abstract])
Or change explicitly type-hint to string at ALL functions (#param string is not enough)
public function getAlias($abstract)
for
public function getAlias(string $abstract)
But it fails later in next use of [$abstract] in Container:
isShared() at isset($this->instances[(string)$abstract]) isset($this->bindings[(string)$abstract]
resolve() calling to$this->resolved[(string)$abstract] = true;
getConcrete() at if (isset($this->bindings[(string)$abstract]))
getContextualConcrete() at if (empty($this->abstractAliases[(string)$abstract]))
getExtenders() at if (isset($this->extenders[(string)$abstract]))
and in Illuminate\Foundation\Application:
make() at if (isset($this->deferredServices[(string)$abstract]) && ! isset($this->instances[(string)$abstract]))
PS: Please have a look to Alvaro Gonzalez's comment in
php - How do I fix this illegal offset type error
I finally found out the issue was send params like ::class which can not be used as an array index.
Strings must be instead

joomla error arising when transfer site to the other hosting

I am trying to transfer Joomla site from one hosting to the other.
The error is:
Fatal error: Call to a member function get() on a non-object in /home/.../templates/beez_20/error.php on line 10
I have found the folowing lines in error.php:
defined('_JEXEC') or die;
$params = JFactory::getApplication()->getTemplate(true)->params;
$logo = $params->get('logo');
Maybe it can't find the parametres, so I should initialize it someway?
Also there are several warnings before fatal error:
Warning: Invalid argument supplied for foreach() in /home/.../public_html/libraries/joomla/access/access.php on line 409
Warning: Invalid argument supplied for foreach() in /home/.../public_html/libraries/joomla/plugin/helper.php on line 59
Warning: Invalid argument supplied for foreach() in /home/.../public_html/libraries/joomla/plugin/helper.php on line 59
Warning: Invalid argument supplied for foreach() in /home/.../public_html/libraries/joomla/application/menu.php on line 63
Warning: Invalid argument supplied for foreach() in /home/.../public_html/includes/application.php on line 462

SyntaxError on pageobject while accessing a select_list within fieldset

I'm trying to access a select_list within a fieldset though Cheezy's pageobject.
The total html is far too long to post (well over 200 lines for just the fieldset), but I can supply the lines with all of the id's and such.
fieldset:
<fieldset class="dartPayer-Insurance" style="width: 730px;">
select_list:
<select id="dartPayer-Payer" style="width: 235px;">
Line in the pageobject I am attempting to use:
select_list(:payer_insurance){ element(:class => "dartPayer-Insurance").select_list_element(:id => "dartPayer-PayerList") }
The error I am getting when I try to run my cucumber test:
(eval):1: syntax error, unexpected '(', expecting $end
{:id=>"dartPayer-Insurance"}(identifier)
^ (SyntaxError)
This error occurs when I try to set the select_list with this line:
self.send(field, input) (Where field is "payer_insurance=" and input is "UMA")
This line works for other pages, so I am fairly certain this is not part of the problem. I'm sure it's a simple bit of syntax in the pageobject line, but I can't find any documentation for using the pageobject quite like I'm trying to. The only reference I can find is within a previous question I asked: Accessing a table within a table (Watir/PageObject)
Could anyone please tell me what I have done wrong?
Thank you in advance for your help.
Update: An example that reproduces the problem:
Given a page with the html:
<fieldset class="dartPayer-Insurance" style="width: 730px;">
<select id="dartPayer-Payer" style="width: 235px;">
<option value="UMA">UMA</option>
</select>
</fieldset>
And a page object defined as:
class MyPage
include PageObject
select_list(:payer_insurance){ element(:class => "dartPayer-Insurance").select_list_element(:id => "dartPayer-PayerList") }
def input_payer(field, input)
self.send(field, input)
end
end
Running the following code:
browser = Watir::Browser.new
browser.goto('C:\Scripts\Misc\Programming\PageObject\test.htm')
page = MyPage.new(browser)
field = "payer_insurance="
input = "UMA"
page.input_payer(field, input)
Generates the following exception:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/page-object-0.9.0/lib/page-object/platforms/watir_webdriver/page_object.rb:968:in `instance_eval': (eval):1: syntax error, unexpected '(', expecting $end (SyntaxError)
{:class=>"dartPayer-Insurance"}(identifier)
^
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/page-object-0.9.0/lib/page-object/platforms/watir_webdriver/page_object.rb:968:in `find_watir_element'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/page-object-0.9.0/lib/page-object/platforms/watir_webdriver/page_object.rb:907:in `element_for'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/page-object-0.9.0/lib/page-object/element_locators.rb:11:in `element'
from pageobject.rb:7:in `block in <class:MyPage>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/page-object-0.9.0/lib/page-object.rb:379:in `instance_eval'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/page-object-0.9.0/lib/page-object.rb:379:in `call_block'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/page-object-0.9.0/lib/page-object/accessors.rb:1089:in `block in standard_methods'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/page-object-0.9.0/lib/page-object/accessors.rb:246:in `block in select_list'
from pageobject.rb:10:in `input_payer'
from pageobject.rb:25:in `<main>'
Solution
The accessor you want for the select list is:
select_list(:payer_insurance){ element(:fieldset, :class => "dartPayer-Insurance").select_list_element(:id => "dartPayer-Payer") }
Problem
You were getting the syntax error due to the following part:
element(:class => "dartPayer-Insurance")
In the API docs for element, you can see that method definition is:
(Object) element(tag, identifier = {:index => 0})
Finds an element
Parameters:
the (Symbol) — name of the tag for the element
identifier (Hash) (defaults to: {:index => 0}) — how we find an element. You can use a multiple paramaters by combining of any of the following except xpath
The original code was missing the tag parameter, which caused the exception.
Note that the select list id was also incorrect - using dartPayer-PayerList instead of dartPayer-Payer.

Resources