required parameter $dompdf follows optional parameter $paper - barryvdh/laravel-dompdf - laravel-7

I am trying to render pdf file with dompdf, but I got this issue:
required parameter $dompdf follows optional parameter $paper
image - required parameter $dompdf follows optional parameter $paper

It probably happens because you are using php 8, and your current laravel dompdf doesn't support new changes of php 8.
To fix it try to use this line in your composer dependency:
"barryvdh/laravel-dompdf": "^0.9.0"
and run:
composer update
For more details see:
https://github.com/barryvdh/laravel-dompdf/issues/747
And you can see what happens in php-8 with function parameters in this issue:
Required parameter $xxx follows optional parameter $yyy

Related

cookie cutter: what's the easiest way to specify variables for the prompts

Is there anything that offers replay-type functionality, by pointing at a predefined prompt-answer file?
What works and what I'd like to achieve.
Let's take an example, using a cookiecutter to prep a Python package for pypi
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git
You've downloaded /Users/jluc/.cookiecutters/cookiecutter-pypackage before. Is it okay to delete and re-download it? [yes]:
full_name [Audrey Roy Greenfeld]: Spartacus 👈 constant for me/my organization
email [audreyr#example.com]: spartacus#example.com 👈 constant for me/my organization
...
project_name [Python Boilerplate]: GladiatorRevolt 👈 this will vary.
project_slug [q]: gladiator-revolt 👈 this too
...
OK, done.
Now, I can easily redo this, for this project, via:
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git --replay
This is great!
What I want:
Say I create another project, UnleashHell.
I want to prep a file somehow that has my developer-info and project level info for Unleash. And I want to be able to run it multiple times against this template, without having to deal with prompts. This particular pypi template gets regular updates, for example python 2.7 support has been dropped.
The problem:
A --replay will just inject the last run for this cookiecutter template. If it was run against a different pypi project, too bad.
I'm good with my developer-level info, but I need to vary all the project level info.
I tried copying the replay file via:
cp ~/.cookiecutter_replay/cookiecutter-pypackage.json unleash.json
Edit unleash.json to reflect necessary changes.
Then specify it via --config-file flag
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git --config-file unleash.json
I get an ugly error, it wants YAML, apparently.
cookiecutter.exceptions.InvalidConfiguration: Unable to parse YAML file .../000.packaging/unleash.json. Error: None of the known patterns match for {
"cookiecutter": {
"full_name": "Spartacus",
No problem, json2yaml to the rescue.
That doesn't work either.
cookiecutter.exceptions.InvalidConfiguration: Unable to parse YAML file ./cookie.yaml. Error: Unable to determine type for "
full_name: "Spartacus"
I also tried a < stdin redirect:
cookiecutter.prompts.txt:
yes
Spartacus
...
It doesn't seem to use it and just aborts.
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git < ./cookiecutter.prompts.txt
You've downloaded ~/.cookiecutters/cookiecutter-pypackage before. Is it okay to delete and re-download it? [yes]
: full_name [Audrey Roy Greenfeld]
: email [audreyr#example.com]
: Aborted
I suspect I am missing something obvious, not sure what. To start with, what is the intent and format expected for the --config file?
Debrief - how I got it working from accepted answer.
Took accepted answer, but adjusted it for ~/.cookiecutterrc usage. It works but the format is not super clear. Especially not on the rc which has to be yaml, though that's not always/often the case with rc files.
This ended up working:
file ~/.cookiecutterrc:
without nesting under default_context... tons of unhelpful yaml parse errors (on a valid yaml doc).
default_context:
#... cut out for privacy
add_pyup_badge: y
command_line_interface: "Click"
create_author_file: "y"
open_source_license: "MIT license"
# the names to use here are:
# full_name:
# email:
# github_username:
# project_name:
# project_slug:
# project_short_description:
# pypi_username:
# version:
# use_pytest:
# use_pypi_deployment_with_travis:
# add_pyup_badge:
# command_line_interface:
# create_author_file:
# open_source_license:
I still could not get a combination of ~/.cookiecutterrc and a project-specific config.yaml to work. Too bad that expected configuration format is so lightly documented.
So I will use the .rc but enter the project name, slug and description each time. Oh well, good enough for now.
You are near.
Try this cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git --no-input --config-file config.yaml
The --no-input parameter will suppress the terminal user input, it is optional of course.
The config.yaml file could look like this:
default_context:
full_name: "Audrey Roy"
email: "audreyr#example.com"
github_username: "audreyr"
cookiecutters_dir: "/home/audreyr/my-custom-cookiecutters-dir/"
replay_dir: "/home/audreyr/my-custom-replay-dir/"
abbreviations:
pp: https://github.com/audreyr/cookiecutter-pypackage.git
gh: https://github.com/{0}.git
bb: https://bitbucket.org/{0}
Reference to this example file: https://cookiecutter.readthedocs.io/en/1.7.0/advanced/user_config.html
You probably just need the default_context block since that is where the user input goes.

Getting error " not enough arguments in call to s.statsd.SendLoop" when running "go build" command

I'm trying to run go build command for my project but it exits with below error.
alpha#GHOST-RIDER:~/GoWorkspace/src/github.com/hyperledger/firstproject$ go build
# github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations
../fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations/system.go:227:23: not enough arguments in call to s.statsd.SendLoop
have (<-chan time.Time, string, string)
want (context.Context, <-chan time.Time, string, string)
Any help would be appreciated.
As per code fabric is using the different version of this library: github.com/go-kit/kit/metrics/statsd. If you follow the System struct's statsd attribute, you can reach the reference on imports.
In master branch of this lib, SendLoop function requires 4 attributes, so that's the root cause. So this causes error when you compile on your local environment.
I had the same issue and worked around it by checking out a tag of library as below:
cd $GOPATH/src/github.com/go-kit/kit
git fetch --tags
git checkout v0.8.0
found a solution on the hyperledger-fabric-go-sdk group chat.
Add context.Background() in s.statsd.SendLoop like below
s.statsd.SendLoop(context.Background(), s.sendTicker.C, network, address)
in fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations/system.go file at line 227.
I had a same issue, my solution worked and don't need edit fabric source code.
specify github.com/go-kit/kit to v0.8.0, modify go.mod:
replace github.com/go-kit/kit => github.com/go-kit/kit v0.8.0 // you specific version
require (
... ...
// Maybe other version, go mod tidy update automatically, don't care it.
github.com/go-kit/kit v0.9.0 // indirect
... ...
)
then it worked.

Is there a html reporter to use with jest-cucumber which shows all the Gherkin annotations on report

I have started using jest-cucumber (https://github.com/bencompton/jest-cucumber) for automating my ReactJS app.
I have tried these reporters with the framework: https://github.com/jest-community/awesome-jest#reporters but I'm not able to see Gherkin steps on the report.
All reports show the test case level details.
I tried to use cucumber-html-reporter https://www.npmjs.com/package/cucumber-html-reporter but unable to use it with jest-cucumber.
Can you suggest any good library which can report the Gherkin annotations step by step which will look like https://www.npmjs.com/package/cucumber-html-reporter
Steps to be followed:
1) Install jest-cucumber with version v2.0.12 that supports reporting. During this writeup this version was not available as stable version of npm. You need to specifically give the version number when installing this.
2) Add below paramter in jest config to specify the report storage location. The jest-cucumber outputs a json file.
reporters: [
"default",
[
"./node_modules/jest-cucumber/dist/src/reporter", //This is the default path
{
formatter: "json",
path: "./tests/integration-test-results/test-report.json" //specific path
}
]
]
3) Create a index.js file for cucumber-html-report conf and mention the location of above created json file and output when the html file need to be placed. For more info, refer: https://www.npmjs.com/package/cucumber-html-reporter
4) Create package.json command as shown below for ease of use so that once the BDD test completes, the report is automatically generated and displayed.
"test-bdd": "jest --config=jest-cucumber.config.js && node ./cucumber-report-config.js"
5) Run: npm run test-bdd
I got it working with cucumber-html-reporter and jest-cucumber version 2.0.12. Please check the issue #27 of jest-cucumber: https://github.com/bencompton/jest-cucumber/issues/27.

How to run aspnet_regiis.exe in a deferred custom action and pass the value of INSTALLDIR property?

I have a custom action (RunEncryption2) that I'm using for encrypting a configuration file by using aspnet_regiis.exe. The custom action type that I'm using is an EXE with path referencing a directory (initial type 34) using deferred execution in system context (so the final type is 3106). The file that I want to encrypt is on INSTALLDIR, so I have a Set Property custom action (SetRunEncryption2, type 51) where I'm setting RunEncryption2=[INSTALLDIR]. My two custom actions look like this:
SetRunEncryption2
Property Name: RunEncryption2
Property Value: [INSTALLDIR]
RunEncryption2
Working Directory: WindowsFolder
File Name & Command line: [WindowsFolder]Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" "[CustomActionData]" -prov "DataProtectionConfigurationProvider"
When the installer runs, I get no error, however the file gets no encryption at all. When I review the log, I get the following:
MSI (s) (34:C0) [17:32:11:356]: Executing op: CustomActionSchedule(Action=RunEncryption2,ActionType=3106,Source=C:\WINDOWS\,Target=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" "" -prov "DataProtectionConfigurationProvider",CustomActionData=C:\Test\)
From the log I can see that the CustomActionData property has been set correctly, however it hasn't been included as part of the command.
At this point the only way I have to make the command work is passing a hard-coded value of INSTALLDIR, otherwise it doesn't seem to work.
I have tried:
Not using CustomActionData, instead passing the value of INSTALLDIR as part of my command line directly.
Using a "Path in Property value" custom action with similar results.
When I run option 1 above, I get a 1722 error on the log:
MSI (s) (C4:50) [12:49:46:968]: Note: 1: 1722 2: RunEncryption2 3: C:\WINDOWS\ 4: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" "C:\Test\" -prov "DataProtectionConfigurationProvider"
Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action RunEncryption2, location: C:\WINDOWS\, command: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" "C:\Test\" -prov "DataProtectionConfigurationProvider"
MSI (s) (C4:50) [12:49:56:841]: Product: TestEncryption -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action RunEncryption2, location: C:\WINDOWS\, command: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" "C:\Test\" -prov "DataProtectionConfigurationProvider"
Does anyone know how can I do to correctly execute this command and dynamically pass the value of INSTALLDIR?
Finally found the problem was not in the custom action passing the properties, but in the way that aspnet_iisreg is expecting the parameters.
INSTALLDIR is passing the string with a trailing slash (e. gr. c:\Test\), when I hard coded the installation path I was passing c:\Test instead.
The solution consisted in creating another custom action that removes the trailing slash and stores the value in a new property, this then can be used as parameter for aspnet_iisreg.
By the way, as Michael Urman mentioned, there was no need to use CustomActionData. Thanks.

Phoenix + ExMachina error

I'm following along this tutorial and after adding this code and a role Factory, I'm getting the following errors:
15:09:08.808 [error] GenServer #PID<0.245.0> terminating
** (UndefinedFunctionError) function Ecto.Adapters.SQL.begin_test_transaction/1 is undefined or private.
Did you mean one of:
* in_transaction?/1
(ecto) Ecto.Adapters.SQL.begin_test_transaction(Pxblog.Repo)
(elixir) src/elixir_compiler.erl:125: :elixir_compiler.dispatch_loaded/6
(elixir) src/elixir_lexical.erl:17: :elixir_lexical.run/3
(elixir) src/elixir_compiler.erl:30: :elixir_compiler.quoted/3
(elixir) lib/code.ex:363: Code.require_file/2
(elixir) lib/enum.ex:651: Enum."-each/2-lists^foreach/1-0-"/2
(elixir) lib/enum.ex:651: Enum.each/2
(mix) lib/mix/tasks/test.ex:216: Mix.Tasks.Test.run/1
Here it is my test_helper.exs file:
{:ok, _} = Application.ensure_all_started(:ex_machina)
ExUnit.start
Mix.Task.run "ecto.create", ~w(-r Pxblog.Repo --quiet)
Mix.Task.run "ecto.migrate", ~w(-r Pxblog.Repo --quiet)
Ecto.Adapters.SQL.begin_test_transaction(Pxblog.Repo)
What could be wrong? I already updated all the dependencies with mix deps.update --all.
Thanks in advance!
It looks like you're trying to follow tutorial targeting Ecto 1.1 having installed Ecto 2.0, that is not fully backwards compatible. You can either downgrade your ecto version, look for an updated tutorial or explore the changes in Ecto 2, and adapt the tutorial you're currently using - http://blog.plataformatec.com.br/2016/04/ecto-2-0-0-rc-is-out/ should give you a good start.

Resources