Skip to main content

Cordova plugins not loading in Ionic

Updating the Cordova plugins... there are two locations to manage the plugins

  • config.xml
  • package.json

I was finding some Cordova functionality was not coming through... through further investigation the two files above had conflicting data.

 

Review the data

package.json

Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead

Oh the treasure of a client coming to you with a site they have removed the previous dev on... treasure hunt.  Not.

Anyway, gaining access to an old site, working through the errors I came across this deprecated code

Deprecated function: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in common_check_language() (line 306 of /path/to/file).

 

Ionic Angular html tag showing in text

The issue

Text through the app is being rendered as

<p>Depletion estimates, Age and size composition, Catch, Effort, Catch rates, Fishing mortality</p>

Therefore, in this instance the HTML p tags are being displayed along with the text.

 

The code

Currently the code outputting this is written as:

Why is Ionic 5 / 6 content padding not working?

If you have upgraded Ionic to 5 or 6 you will have experienced that the padding attribute is not working anymore.

<ion-content padding *ngIf="loaded" color="medium">

Use of attributes was deprecated in Ionic v4.  If you would have noticed in developers console, Ionic 4 was presenting warnings of using these attributes.  So post Ionic 4, these attributes were transitioned to CSS classes.

Updating Capacitor – get and set versions

Need to know how run updates for Capacitor?

Updating Capacitor

Update Capacitor Core and CLI with the commands:

npm install @capacitor/cli
npm install @capacitor/core

Whereas, to update the relevant platforms in use:

npm install @capacitor/ios
npm install @capacitor/android

 

Drupal contrib module changes save to a patch file

If you edit a Drupal contrib module, the next time the module is updated those edits will be wiped.  So they are not lost there are a couple of options for you to consider:

  • Are the edits worth the contributing to the community?  Yes, you can fork the repo and add the changes for the developer(s) to review; or
  • Create a patch file

 

Creating a patch file

The process:

Create a MySQL database using command line (CLI)

On your local OSX environment using Terminal or iTerm you can create a MySQL database, database user, and password, as well as, assign all privileges to the user for the database.

Knowing your credentials, before beginning you will need to know the following:

user: {user}
password: {password}
database: {database}

For my local environment, I'll be using these credentials

Subscribe to